pex: use pubkey directly instead of accessing local_host in pex_msg_init()
authorFelix Fietkau <nbd@nbd.name>
Wed, 3 Aug 2022 20:27:01 +0000 (22:27 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 23 Aug 2022 11:48:18 +0000 (13:48 +0200)
Signed-off-by: Felix Fietkau <nbd@nbd.name>
pex.c

diff --git a/pex.c b/pex.c
index 23ee57c4bb0d5901ab1c187666b6ff4a1c930d30..5b27921c94954320877938bcdcaded80e9833bb3 100644 (file)
--- 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;
 }