mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added some logic to keep a mac address that has no associated port from being added to the ipv4_mac table. I found that a cisco device was trying to add a loop-back mac address (000000000000).
This commit is contained in:
@@ -43,11 +43,17 @@ foreach (explode("\n", $ipNetToMedia_data) as $data)
|
||||
dbUpdate(array('mac_address' => $clean_mac), 'ipv4_mac', 'port_id=? AND ipv4_address=?',array($interface['port_id'],$ip));
|
||||
echo(".");
|
||||
}
|
||||
else
|
||||
elseif (isset($interface['port_id']))
|
||||
{
|
||||
echo("+");
|
||||
#echo("Add MAC $mac\n");
|
||||
dbInsert(array('port_id' => $interface['port_id'], 'mac_address' => $clean_mac, 'ipv4_address' => $ip), 'ipv4_mac');
|
||||
$insert_data = array(
|
||||
'port_id' => $interface['port_id'],
|
||||
'mac_address' => $clean_mac,
|
||||
'ipv4_address' => $ip
|
||||
);
|
||||
|
||||
dbInsert($insert_data, 'ipv4_mac');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user