diff options
| author | Felix Fietkau | 2023-08-21 20:31:34 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2023-08-21 20:31:35 +0000 |
| commit | 48049524d4fc255d78f054549c75863ca87770d6 (patch) | |
| tree | 1cca3cda445996b9a674abee0a3f435969ff4e7b | |
| parent | 29aacb9386e058408ed8a835bad37d58d3c9d57f (diff) | |
| download | unetd-48049524d4fc255d78f054549c75863ca87770d6.tar.gz | |
pex: do not send peer notifications for hosts with a gateway
These notifications will be useless to all other hosts
Signed-off-by: Felix Fietkau <nbd@nbd.name>
| -rw-r--r-- | pex.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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++; } |