]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
daemon: do not use 00:00:00:00:00:00 as chassis ID
authorVincent Bernat <vincent@bernat.ch>
Thu, 18 Aug 2022 21:56:47 +0000 (23:56 +0200)
committerVincent Bernat <vincent@bernat.ch>
Thu, 18 Aug 2022 21:56:47 +0000 (23:56 +0200)
Fix #541

NEWS
src/daemon/interfaces.c

diff --git a/NEWS b/NEWS
index ee9c8851bb6d8b4d91f20268d47ce1ecf6ade579..d8306efa53f314fb5b81aa8c01244f5e72bedfd2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+lldpd (1.0.16)
+ * Fix:
+   + Do not use 00:00:00:00:00:00 as chassis ID.
+
 lldpd (1.0.15)
  * Changes
    + Add configure command to override system capabilities. Contributed by
index a59b6afd0642470ca35d8a25499f9727885a88e2..9596573b896c48f0a936863a531752cf5c27accc 100644 (file)
@@ -350,6 +350,7 @@ interfaces_helper_chassis(struct lldpd *cfg,
        struct interfaces_device *iface;
        struct lldpd_hardware *hardware;
        char *name = NULL;
+       static u_int8_t zero_mac[] = {0, 0, 0, 0, 0, 0};
 
        if (!cfg->g_config.c_cap_override) {
                LOCAL_CHASSIS(cfg)->c_cap_enabled &=
@@ -383,6 +384,9 @@ interfaces_helper_chassis(struct lldpd *cfg,
                            iface->index)) == NULL)
                        /* That's odd. Let's skip. */
                        continue;
+               if (memcmp(hardware->h_lladdr, zero_mac, ETHER_ADDR_LEN) == 0)
+                       /* All-zero MAC address */
+                       continue;
 
                name = malloc(ETHER_ADDR_LEN);
                if (!name) {