From 1f4aa8995032ca121611a4b74d8cff273b528ce9 Mon Sep 17 00:00:00 2001 From: Geert Hauwaerts Date: Thu, 25 Feb 2010 21:42:15 +0000 Subject: [PATCH] BUGFIX: The MAC address change detection code did not use the proper interface to compare against. So false MAC change alerts where being send when using VRRP or LACP/PortChannel interfaces. git-svn-id: http://www.observium.org/svn/observer/trunk@954 61d68cd4-352d-0410-923a-c4978735b2b8 --- includes/discovery/arp-table.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/discovery/arp-table.inc.php b/includes/discovery/arp-table.inc.php index 3529f1813..dbe790007 100644 --- a/includes/discovery/arp-table.inc.php +++ b/includes/discovery/arp-table.inc.php @@ -35,7 +35,7 @@ $mac_table[$interface_id][$clean_mac] = 1; if(mysql_result(mysql_query("SELECT COUNT(*) from ipv4_mac WHERE interface_id = '".$interface['interface_id']."' AND ipv4_address = '$ip'"),0)) { $sql = "UPDATE `ipv4_mac` SET `mac_address` = '$clean_mac' WHERE interface_id = '".$interface['interface_id']."' AND ipv4_address = '$ip'"; - $old_mac = mysql_fetch_row(mysql_query("SELECT mac_address from ipv4_mac WHERE ipv4_address='$ip'")); + $old_mac = mysql_fetch_row(mysql_query("SELECT mac_address from ipv4_mac WHERE ipv4_address='$ip' AND interface_id = '".$interface['interface_id']."'")); if($clean_mac != $old_mac[0]) { if ($debug) { echo "Changed mac address for $ip from $old_mac[0] to $clean_mac\n"; }