mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Don't overwrite real port ids with zeros in the FDB (#11041)
Avoid writing "0" as port id when the data came back incomplete from the snmp poll, and when the existing data in the DB already contains a port. Keep the existing port id instead.
This commit is contained in:
@@ -41,7 +41,9 @@ if (!empty($insert)) {
|
||||
$new_port = $entry['port_id'];
|
||||
$port_fdb_id = $existing_fdbs[$vlan_id][$mac_address_entry]['ports_fdb_id'];
|
||||
|
||||
if ($existing_fdbs[$vlan_id][$mac_address_entry]['port_id'] != $new_port) {
|
||||
// Sometimes new_port ends up as 0 if we didn't get a complete dot1dBasePort
|
||||
// dictionary from BRIDGE-MIB - don't write a 0 over a previously known port
|
||||
if ($existing_fdbs[$vlan_id][$mac_address_entry]['port_id'] != $new_port && $new_port != 0) {
|
||||
DB::table('ports_fdb')
|
||||
->where('ports_fdb_id', $port_fdb_id)
|
||||
->update([
|
||||
|
Reference in New Issue
Block a user