]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
Make "too many neighbors for port" msg appear less frequently
authorSam Tannous <stannous@cumulusnetworks.com>
Tue, 8 Jul 2014 19:15:43 +0000 (15:15 -0400)
committerVincent Bernat <vincent@bernat.im>
Tue, 8 Jul 2014 19:47:34 +0000 (21:47 +0200)
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 <roopa@cumulusnetworks.com>
Signed-off-by: Sam Tannous <stannous@cumulusnetworks.com>
src/daemon/lldpd.c

index 5c197488f7ed7a7d4bb3f92682240d0f30ccbed8..d9575b961f5f96b2104161705ef4c341106b8105 100644 (file)
@@ -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) {