feat: include remote chassis MAC in LLDP neighbor entries

Enables MAC-based topology matching against devices that report their
own MAC but not a usable system name.
This commit is contained in:
Christian Manivong
2026-06-12 21:08:36 +02:00
parent 499d48c379
commit 8cc48ca383
+7 -2
View File
@@ -257,10 +257,15 @@ class LinuxDriver(OSDriver):
entries.setdefault(iface, {})[subkey] = value
for iface, data in entries.items():
neighbors.setdefault(iface, []).append({
entry = {
"hostname": data.get("chassis.name", ""),
"port": data.get("port.ifname", data.get("port.id.value", "")),
})
}
if data.get("chassis.id.subtype") == "mac":
mac = data.get("chassis.id.value", "")
if re.match(r"^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$", mac):
entry["mac"] = mac.lower()
neighbors.setdefault(iface, []).append(entry)
return neighbors