From 45a481419d9b2fd96e49378ab5115d2c800b712d Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 3 Aug 2022 22:27:01 +0200 Subject: [PATCH] pex: use pubkey directly instead of accessing local_host in pex_msg_init() Signed-off-by: Felix Fietkau --- pex.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pex.c b/pex.c index 23ee57c..5b27921 100644 --- a/pex.c +++ b/pex.c @@ -76,13 +76,12 @@ pex_msg_peer(struct network *net, const uint8_t *id) static struct pex_hdr *pex_msg_init(struct network *net, uint8_t opcode) { - struct network_peer *local = &net->net_config.local_host->peer; struct pex_hdr *hdr = (struct pex_hdr *)tx_buf; hdr->version = 0; hdr->opcode = opcode; hdr->len = 0; - memcpy(hdr->id, local->key, sizeof(hdr->id)); + memcpy(hdr->id, net->config.pubkey, sizeof(hdr->id)); return hdr; } -- 2.30.2