Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MAC address change false positives #292

Merged
merged 1 commit into from Sep 28, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions includes/discovery/arp-table.inc.php
Expand Up @@ -35,10 +35,10 @@
//$sql = "UPDATE `ipv4_mac` SET `mac_address` = '$clean_mac' WHERE port_id = '".$interface['port_id']."' AND ipv4_address = '$ip'";
$old_mac = dbFetchCell("SELECT mac_address from ipv4_mac WHERE ipv4_address=? AND port_id=?",array($ip,$interface['port_id']));

if ($clean_mac != $old_mac[0] && $clean_mac != '' && $old_mac[0] != '')
if ($clean_mac != $old_mac && $clean_mac != '' && $old_mac != '')
{
if ($debug) { echo("Changed mac address for $ip from $old_mac[0] to $clean_mac\n"); }
log_event("MAC change: $ip : " . mac_clean_to_readable($old_mac[0]) . " -> " . mac_clean_to_readable($clean_mac), $device, "interface", $interface['port_id']);
if ($debug) { echo("Changed mac address for $ip from $old_mac to $clean_mac\n"); }
log_event("MAC change: $ip : " . mac_clean_to_readable($old_mac) . " -> " . mac_clean_to_readable($clean_mac), $device, "interface", $interface['port_id']);
}
dbUpdate(array('mac_address' => $clean_mac), 'ipv4_mac', 'port_id=? AND ipv4_address=?',array($interface['port_id'],$ip));
echo(".");
Expand Down