ndp: fix adding proxy neighbor entries
authorHans Dedecker <dedeckeh@gmail.com>
Fri, 28 Apr 2017 07:58:54 +0000 (09:58 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Fri, 28 Apr 2017 08:19:24 +0000 (10:19 +0200)
Proxy neighbor entries were not created for proxy enabled interfaces
if the first interface was not enabled

Signed-off-by: Hans Dedecker <dedeckeh@gmail.com>
src/ndp.c

index 1e3714eb8a810c13331bf6a4d4d655ebbc5502c6..49aea1cb5e0479d2dbc7cecf9ee724a8cafbc5a1 100644 (file)
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -403,14 +403,14 @@ static void setup_addr_for_relaying(struct in6_addr *addr, struct interface *ifa
                if (iface == c || (c->ndp != RELAYD_RELAY && !add))
                        continue;
 
-               add = (c->ndp == RELAYD_RELAY ? add : false);
+               bool neigh_add = (c->ndp == RELAYD_RELAY ? add : false);
 
-               if (odhcpd_setup_proxy_neigh(addr, c, add))
+               if (odhcpd_setup_proxy_neigh(addr, c, neigh_add))
                        syslog(LOG_DEBUG, "Failed to %s proxy neighbour entry %s%%%s",
-                               add ? "add" : "delete", ipbuf, c->ifname);
+                               neigh_add ? "add" : "delete", ipbuf, c->ifname);
                else
                        syslog(LOG_DEBUG, "%s proxy neighbour entry %s%%%s",
-                               add ? "Added" : "Deleted", ipbuf, c->ifname);
+                               neigh_add ? "Added" : "Deleted", ipbuf, c->ifname);
        }
 }