From ad21b578b215def7bdcebd99831c9b2b9c685fed Mon Sep 17 00:00:00 2001 From: Sam Tannous Date: Tue, 8 Jul 2014 15:15:43 -0400 Subject: [PATCH] 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 --- src/daemon/lldpd.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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) { -- 2.39.5