projects
/
project
/
unetd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
29aacb9
)
pex: do not send peer notifications for hosts with a gateway
author
Felix Fietkau
<
[email protected]
>
Mon, 21 Aug 2023 20:31:34 +0000
(22:31 +0200)
committer
Felix Fietkau
<
[email protected]
>
Mon, 21 Aug 2023 20:31:35 +0000
(22:31 +0200)
These notifications will be useless to all other hosts
Signed-off-by: Felix Fietkau <
[email protected]
>
pex.c
patch
|
blob
|
history
diff --git
a/pex.c
b/pex.c
index 61977cc007ce1f2cb67a0048d0037a0a48340d6f..8d99d505ba834c7bf3f99b085563d0d2b911f1b1 100644
(file)
--- a/
pex.c
+++ b/
pex.c
@@
-509,10
+509,16
@@
network_pex_recv_query(struct network *net, struct network_peer *peer,
pex_msg_init(net, PEX_MSG_NOTIFY_PEERS);
for (; len >= 8; data += 8, len -= 8) {
+ struct network_host *host;
+
cur = pex_msg_peer(net, data, false);
if (!cur || !cur->state.connected)
continue;
+ host = container_of(peer, struct network_host, peer);
+ if (host->gateway)
+ continue;
+
if (!pex_msg_add_peer_endpoint(net, cur, peer))
resp++;
}