From fdafb7fc7cd6981f9499771c95ccb955c326bcf5 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Wed, 14 Oct 2009 00:40:08 +1300 Subject: [PATCH] Bug 2795: acl arp lookups including port ARP lookup sockaddr need to only contain the fields being tested for. --- src/acl/Arp.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/acl/Arp.cc b/src/acl/Arp.cc index c3d2233bff..49eaade5c3 100644 --- a/src/acl/Arp.cc +++ b/src/acl/Arp.cc @@ -248,6 +248,7 @@ aclMatchArp(SplayNode **dataptr, IpAddress &c) #endif IpAddress ipAddr = c; + ipAddr.SetPort(0); // ARP will fail if the port is included in the match. #if defined(_SQUID_LINUX_) @@ -298,7 +299,7 @@ aclMatchArp(SplayNode **dataptr, IpAddress &c) acl_arp_data X; memcpy (X.eth, arpReq.arp_ha.sa_data, 6); *Top = (*Top)->splay(&X, aclArpCompare); - debugs(28, 3, "aclMatchArp: '" << c << "' " << (splayLastResult ? "NOT found" : "found")); + debugs(28, 3, "aclMatchArp: '" << ipAddr << "' " << (splayLastResult ? "NOT found" : "found")); return (0 == splayLastResult); } @@ -332,7 +333,7 @@ aclMatchArp(SplayNode **dataptr, IpAddress &c) if (NULL != strchr(ifr->ifr_name, ':')) continue; - debugs(28, 4, "Looking up ARP address for " << c << " on " << ifr->ifr_name); + debugs(28, 4, "Looking up ARP address for " << ipAddr << " on " << ifr->ifr_name); /* Set up structures for ARP lookup */ @@ -384,7 +385,7 @@ aclMatchArp(SplayNode **dataptr, IpAddress &c) /* Return if match, otherwise continue to other interfaces */ if (0 == splayLastResult) { - debugs(28, 3, "aclMatchArp: " << c << " found on " << ifr->ifr_name); + debugs(28, 3, "aclMatchArp: " << ipAddr << " found on " << ifr->ifr_name); return 1; } @@ -432,7 +433,7 @@ aclMatchArp(SplayNode **dataptr, IpAddress &c) /* Do lookup */ *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare); - debugs(28, 3, "aclMatchArp: '" << c << "' " << (splayLastResult ? "NOT found" : "found")); + debugs(28, 3, "aclMatchArp: '" << ipAddr << "' " << (splayLastResult ? "NOT found" : "found")); return (0 == splayLastResult); } @@ -533,7 +534,7 @@ aclMatchArp(SplayNode **dataptr, IpAddress &c) /* Do lookup */ *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare); - debugs(28, 3, "aclMatchArp: '" << c << "' " << (splayLastResult ? "NOT found" : "found")); + debugs(28, 3, "aclMatchArp: '" << ipAddr << "' " << (splayLastResult ? "NOT found" : "found")); return (0 == splayLastResult); @@ -598,7 +599,7 @@ aclMatchArp(SplayNode **dataptr, IpAddress &c) /* Do lookup */ *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare); - debugs(28, 3, "aclMatchArp: '" << c << "' " << (splayLastResult ? "NOT found" : "found")); + debugs(28, 3, "aclMatchArp: '" << ipAddr << "' " << (splayLastResult ? "NOT found" : "found")); return (0 == splayLastResult); @@ -610,7 +611,7 @@ aclMatchArp(SplayNode **dataptr, IpAddress &c) /* * Address was not found on any interface */ - debugs(28, 3, "aclMatchArp: " << c << " NOT found"); + debugs(28, 3, "aclMatchArp: " << ipAddr << " NOT found"); return 0; } -- 2.47.2