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:
@@ -1014,9 +1014,11 @@ class NetgearSmartDriver(SwitchDriver):
|
||||
"""
|
||||
neighbors: Dict[str, List[Dict]] = {}
|
||||
for row in self._get_lldp_table():
|
||||
neighbors.setdefault(row["local_port"], []).append(
|
||||
{"hostname": row["system_name"], "port": row["port_id"]}
|
||||
)
|
||||
entry = {"hostname": row["system_name"], "port": row["port_id"]}
|
||||
chassis_id = row.get("remote_chassis_id", "")
|
||||
if re.match(r"^([0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]{2}$", chassis_id):
|
||||
entry["mac"] = chassis_id.lower()
|
||||
neighbors.setdefault(row["local_port"], []).append(entry)
|
||||
return neighbors
|
||||
|
||||
def _get_lldp_table(self) -> List[Dict]:
|
||||
|
||||
Reference in New Issue
Block a user