summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau2026-02-13 17:16:28 +0000
committerFelix Fietkau2026-02-15 12:45:06 +0000
commit52e504192ea746632e99abd75f07438c0237ff1a (patch)
treefa46bc5c3c4ae830302e2a1b90399fb0cc244480
parent35c182b74fa4f9002fba6f8b1808b29e3106bdcb (diff)
downloadunetd-master.tar.gz
host: fix gateway peers getting allowed IPs of unrelated hostsHEADmaster
When the local node is a gateway for a peer, network_host_uses_peer_route() incorrectly added all other hosts' IPs to that peer's allowed IPs. This caused WireGuard to steal IP assignments from other peers, leaving them with no allowed IPs and breaking routing. The faulty condition checked if the peer uses the local host as its gateway and if so, routed all other hosts through that peer. This is wrong: a peer using us as a gateway should only have its own IPs in its allowed IPs, not every other host's. Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--host.h4
1 files changed, 0 insertions, 4 deletions
diff --git a/host.h b/host.h
index afe2d72..52ce36d 100644
--- a/host.h
+++ b/host.h
@@ -109,10 +109,6 @@ network_host_uses_peer_route(struct network_host *host, struct network *net,
!strcmp(net->net_config.local_host->gateway, network_peer_name(peer)))
return true;
- if (peer_host->gateway &&
- !strcmp(peer_host->gateway, network_host_name(net->net_config.local_host)))
- return true;
-
if (!host->gateway)
return false;