From aada199b3b8021cb9d50da0c32e19d16d015f7c5 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 18 Aug 2022 23:56:47 +0200 Subject: [PATCH] daemon: do not use 00:00:00:00:00:00 as chassis ID Fix #541 --- NEWS | 4 ++++ src/daemon/interfaces.c | 4 ++++ 2 files changed, 8 insertions(+) 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) { -- 2.39.5