From af291f4fc7c2cfb606d9df89a4f8b75c4eeed2bb Mon Sep 17 00:00:00 2001 From: mchasteen Date: Wed, 18 Feb 2015 08:36:57 -0700 Subject: [PATCH] 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). --- includes/discovery/arp-table.inc.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/includes/discovery/arp-table.inc.php b/includes/discovery/arp-table.inc.php index bd20dd5a5..919e963c1 100644 --- a/includes/discovery/arp-table.inc.php +++ b/includes/discovery/arp-table.inc.php @@ -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'); } } }