Trust directly-scanned mgmt IP over neighbor-reported LLDP value

Some vendors (e.g. HP/Aruba ProCurve) advertise a per-port Management
Address TLV that reflects whatever VLAN is routable out that link,
not the switch's real management IP. A neighbor's LLDP report could
therefore overwrite a switch's correct mgmt_ip with a wrong one.
upsert_switch() now takes a trusted flag: a direct scan's mgmt_ip
always wins, while a neighbor-reported one only fills in a blank
value.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
dcstephenson
2026-09-18 11:50:57 -05:00
parent 5ffadfae17
commit a84c09d9cd
2 changed files with 19 additions and 4 deletions
+1
View File
@@ -105,6 +105,7 @@ def run_scan(dept: str = None, workers: int = 5, login_delay: int = 3):
firmware=result.get("firmware", ""),
vendor=result.get("vendor", ""),
serial=result.get("serial", ""),
trusted=True,
)
for neighbor in result["neighbors"]: