]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug #909: ARP Support on FreeBSD
authorhno <>
Sun, 7 Nov 2004 04:57:53 +0000 (04:57 +0000)
committerhno <>
Sun, 7 Nov 2004 04:57:53 +0000 (04:57 +0000)
From Guido Serassio  2004-10-23 14:57

The new FreeBSD code doesn't build.

There are some C++ problems, and the Solaris section seems to be affected too.

src/ACLARP.cc

index bf3f1fc987038185a31212e598e4a9d42d9844f2..6cee30162336e0d61c525c7e0d753f0c5735fbc1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLARP.cc,v 1.6 2004/10/17 22:13:03 hno Exp $
+ * $Id: ACLARP.cc,v 1.7 2004/11/06 21:57:53 hno Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -35,6 +35,7 @@
  */
 
 #include "config.h"
+#include "squid.h"
 
 #ifdef _SQUID_SOLARIS_
 #include <sys/sockio.h>
 #endif
 #include <net/route.h>
 #include <net/if.h>
-#ifdef _SQUID_FREEBSD__
+#ifdef _SQUID_FREEBSD_
 #include <net/if_arp.h>
 #endif
 #if HAVE_NETINET_IF_ETHER_H
 #include <netinet/if_ether.h>
 #endif
 
-#include "squid.h"
 #include "ACLARP.h"
 
 #if !USE_ARP_ACL
@@ -375,14 +375,6 @@ aclMatchArp(SplayNode<acl_arp_data *> **dataptr, struct in_addr c)
 
     struct sockaddr_in ipAddr;
 
-    unsigned char ifbuffer[sizeof(struct ifreq) * 64];
-
-    struct ifconf ifc;
-
-    struct ifreq *ifr;
-
-    int offset;
-
     SplayNode<acl_arp_data *> **Top = dataptr;
 
     /*
@@ -418,7 +410,7 @@ aclMatchArp(SplayNode<acl_arp_data *> **dataptr, struct in_addr c)
                       arpReq.arp_ha.sa_data[4] & 0xff, arpReq.arp_ha.sa_data[5] & 0xff);
 
         /* Do lookup */
-        *Top = (*Top)->splay(&arpReq.arp_ha.sa_data, aclArpCompare);
+        *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare);
 
         debug(28, 3) ("aclMatchArp: '%s' %s\n",
                       inet_ntoa(c), splayLastResult ? "NOT found" : "found");
@@ -432,14 +424,6 @@ aclMatchArp(SplayNode<acl_arp_data *> **dataptr, struct in_addr c)
 
     struct sockaddr_in ipAddr;
 
-    unsigned char ifbuffer[sizeof(struct ifreq) * 64];
-
-    struct ifconf ifc;
-
-    struct ifreq *ifr;
-
-    int offset;
-
     SplayNode<acl_arp_data *> **Top = dataptr;
 
     int mib[6];
@@ -485,7 +469,7 @@ aclMatchArp(SplayNode<acl_arp_data *> **dataptr, struct in_addr c)
         return 0;
     }
 
-    if ((buf = xmalloc(needed)) == NULL) {
+    if ((buf = (char *)xmalloc(needed)) == NULL) {
         debug(28, 0) ("Can't allocate temporary ARP table!\n");
         return 0;
     }
@@ -533,7 +517,7 @@ aclMatchArp(SplayNode<acl_arp_data *> **dataptr, struct in_addr c)
                   arpReq.arp_ha.sa_data[4] & 0xff, arpReq.arp_ha.sa_data[5] & 0xff);
 
     /* Do lookup */
-    *Top = (*Top)->splay(&arpReq.arp_ha.sa_data, aclArpCompare);
+    *Top = (*Top)->splay((acl_arp_data *)&arpReq.arp_ha.sa_data, aclArpCompare);
 
     debug(28, 3) ("aclMatchArp: '%s' %s\n",
                   inet_ntoa(c), splayLastResult ? "NOT found" : "found");