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:
mchasteen
2015-02-18 08:36:57 -07:00
committed by laf
parent dd55334293
commit af291f4fc7

View File

@@ -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');
}
}
}