From: Sam Tannous Date: Tue, 8 Jul 2014 19:15:43 +0000 (-0400) Subject: Make "too many neighbors for port" msg appear less frequently X-Git-Tag: 0.7.10~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ad21b578b215def7bdcebd99831c9b2b9c685fed;p=thirdparty%2Flldpd.git Make "too many neighbors for port" msg appear less frequently There is a max neighbors setting (default value 4). It prints a msg everytime it gets a new neighbor > 4. This patch just makes it appear less often. Signed-off-by: Roopa Prabhu Signed-off-by: Sam Tannous --- diff --git a/src/daemon/lldpd.c b/src/daemon/lldpd.c index 5c197488..d9575b96 100644 --- a/src/daemon/lldpd.c +++ b/src/daemon/lldpd.c @@ -515,15 +515,22 @@ lldpd_decode(struct lldpd *cfg, char *frame, int s, } } /* Do we have room for a new MSAP? */ - if (!oport && cfg->g_config.c_max_neighbors && - count > cfg->g_config.c_max_neighbors - 1) { - log_info("decode", + if (!oport && cfg->g_config.c_max_neighbors) { + if (count == (cfg->g_config.c_max_neighbors - 1)) { + log_debug("decode", + "max neighbors %d reached for port %s, " + "dropping any new ones silently", + cfg->g_config.c_max_neighbors, + hardware->h_ifname); + } else if (count > cfg->g_config.c_max_neighbors - 1) { + log_debug("decode", "too many neighbors for port %s, drop this new one", hardware->h_ifname); lldpd_port_cleanup(port, 1); lldpd_chassis_cleanup(chassis, 1); free(port); return; + } } /* No, but do we already know the system? */ if (!oport) {