From: Vincent Bernat Date: Thu, 18 Aug 2022 21:56:47 +0000 (+0200) Subject: daemon: do not use 00:00:00:00:00:00 as chassis ID X-Git-Tag: 1.0.16~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aada199b3b8021cb9d50da0c32e19d16d015f7c5;p=thirdparty%2Flldpd.git daemon: do not use 00:00:00:00:00:00 as chassis ID Fix #541 --- diff --git a/NEWS b/NEWS index ee9c8851..d8306efa 100644 --- 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 diff --git a/src/daemon/interfaces.c b/src/daemon/interfaces.c index a59b6afd..9596573b 100644 --- a/src/daemon/interfaces.c +++ b/src/daemon/interfaces.c @@ -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) {