Fix false LLDP_MISMATCH: compare the switch's name with the server's lldpd neighbour

The switch port's LLDP entry describes the server, while the server's lldpctl
describes the switch, so the two were never comparable and every link with lldpd
running was flagged as cross-cabled. Pass the switch name in the port data and
compare it with the server's neighbour instead; skip the check without it.
This commit is contained in:
2026-10-03 02:23:26 -04:00
parent e0ff3e2168
commit fed279a0bd
3 changed files with 24 additions and 7 deletions
+1
View File
@@ -436,6 +436,7 @@ def api_diagnose_start():
if pd.get('port_idx') == port_idx:
port_data = dict(pd)
port_data['name'] = pname
port_data['switch_name'] = switch_name
break
if not port_data:
return jsonify({'error': f'Port {port_idx} not found on switch "{switch_name}"'}), 404