ndp: fix syslog flooding (FS#2242)
authorHans Dedecker <dedeckeh@gmail.com>
Tue, 23 Apr 2019 13:07:52 +0000 (15:07 +0200)
committerHans Dedecker <dedeckeh@gmail.com>
Tue, 23 Apr 2019 13:27:46 +0000 (15:27 +0200)
Only log a syslog error in case adding of a proxy neighbor fails as a delete
failure cannot be considered as a syslog error for all cases.

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

index 41b006463e146001cc83b60d92b099b8670dcd4c..64a6c1c5ce40fcf1face31391943bc59f36eb6a0 100644 (file)
--- a/src/ndp.c
+++ b/src/ndp.c
@@ -361,11 +361,12 @@ static void setup_addr_for_relaying(struct in6_addr *addr, struct interface *ifa
                if (iface == c || c->ndp != MODE_RELAY)
                        continue;
 
-               if (netlink_setup_proxy_neigh(addr, c->ifindex, add))
-                       syslog(LOG_ERR, "Failed to %s proxy neighbour entry %s on %s",
-                               add ? "add" : "delete", ipbuf, c->name);
-               else
+               if (netlink_setup_proxy_neigh(addr, c->ifindex, add)) {
+                       if (add)
+                               syslog(LOG_ERR, "Failed to add proxy neighbour entry %s on %s",
+                                      ipbuf, c->name);
+               } else
                        syslog(LOG_DEBUG, "%s proxy neighbour entry %s on %s",
-                               add ? "Added" : "Deleted", ipbuf, c->name);
+                              add ? "Added" : "Deleted", ipbuf, c->name);
        }
 }