diff options
author | Hans Dedecker <dedeckeh@gmail.com> | 2019-03-21 14:17:50 +0100 |
---|---|---|
committer | Hans Dedecker <dedeckeh@gmail.com> | 2019-03-21 15:41:39 +0100 |
commit | e4a24dcb5aa48fdace3d6482db262bde9969b5bb (patch) | |
tree | cc66a7028ed8793641c41d8d0dcd3a42487bca54 /src | |
parent | 4ca7f7e12118ece6aa589f9c45e1cec5404ff415 (diff) |
ndp: fix adding proxy neighbor entries
In case multiple logical OpenWrt interfaces are stacked on the same device
and one of the interfaces is configured in relay and the other not; adding
a proxy neighbor entry will result into it immediately being deleted if
the interface in non relay mode comes last.
Fix this by not doing a delete on the interface which is not configured in
relay mode.
Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/ndp.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -342,16 +342,14 @@ static void setup_addr_for_relaying(struct in6_addr *addr, struct interface *ifa inet_ntop(AF_INET6, addr, ipbuf, sizeof(ipbuf)); avl_for_each_element(&interfaces, c, avl) { - if (iface == c || (c->ndp != MODE_RELAY && !add)) + if (iface == c || c->ndp != MODE_RELAY) continue; - bool neigh_add = (c->ndp == MODE_RELAY ? add : false); - - if (netlink_setup_proxy_neigh(addr, c->ifindex, neigh_add)) + if (netlink_setup_proxy_neigh(addr, c->ifindex, add)) syslog(LOG_DEBUG, "Failed to %s proxy neighbour entry %s on %s", - neigh_add ? "add" : "delete", ipbuf, c->name); + add ? "add" : "delete", ipbuf, c->name); else syslog(LOG_DEBUG, "%s proxy neighbour entry %s on %s", - neigh_add ? "Added" : "Deleted", ipbuf, c->name); + add ? "Added" : "Deleted", ipbuf, c->name); } } |