]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ARP acl support for OpenBSD, code common with the FreeBSD implementation.
authorserassio <>
Sat, 29 Jul 2006 22:17:29 +0000 (22:17 +0000)
committerserassio <>
Sat, 29 Jul 2006 22:17:29 +0000 (22:17 +0000)
configure
configure.in
src/ACLARP.cc

index 975c81e433135f5cfe82044f4615e49fb4e991ff..ec3bbb97b34ccda916656944e61e662b1ed85023 100755 (executable)
--- a/configure
+++ b/configure
@@ -20815,6 +20815,8 @@ if test "${enable_arp_acl+set}" = set; then
            ;;
        *-freebsd*)
            ;;
+       *-openbsd*)
+           ;;
        *-cygwin*)
         LIBS="$LIBS -liphlpapi"
            ;;
index ef30180f8b20c9a7d45b53568d62ab348f007aa4..947b3ac23309ce14dfdb86dc2eb50927442950a5 100644 (file)
@@ -1,7 +1,7 @@
 
 dnl  Configuration input file for Squid
 dnl
-dnl  $Id: configure.in,v 1.426 2006/07/02 19:27:17 serassio Exp $
+dnl  $Id: configure.in,v 1.427 2006/07/29 16:17:29 serassio Exp $
 dnl
 dnl
 dnl
@@ -11,7 +11,7 @@ AM_CONFIG_HEADER(include/autoconf.h)
 AC_CONFIG_AUX_DIR(cfgaux)
 AC_CONFIG_SRCDIR([src/main.cc])
 AM_INIT_AUTOMAKE([tar-ustar])
-AC_REVISION($Revision: 1.426 $)dnl
+AC_REVISION($Revision: 1.427 $)dnl
 AC_PREFIX_DEFAULT(/usr/local/squid)
 AM_MAINTAINER_MODE
 
@@ -863,6 +863,8 @@ AC_ARG_ENABLE(arp-acl,
            ;;
        *-freebsd*)
            ;;
+       *-openbsd*)
+           ;;
        *-cygwin*)
         LIBS="$LIBS -liphlpapi"
            ;;
index 937776f75fdd86e0f749991d0be27323c698d5a6..fbcf6b2ac4603a966b47b562b16fb978421b6099 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ACLARP.cc,v 1.21 2006/07/21 15:24:58 serassio Exp $
+ * $Id: ACLARP.cc,v 1.22 2006/07/29 16:17:29 serassio Exp $
  *
  * DEBUG: section 28    Access Control
  * AUTHOR: Duane Wessels
@@ -67,7 +67,7 @@ struct arpreq
 #endif
 #include <net/route.h>
 #include <net/if.h>
-#ifdef _SQUID_FREEBSD_
+#if defined(_SQUID_FREEBSD_) || defined(_SQUID_OPENBSD_)
 #include <net/if_arp.h>
 #endif
 #if HAVE_NETINET_IF_ETHER_H
@@ -437,7 +437,7 @@ aclMatchArp(SplayNode<acl_arp_data *> **dataptr, struct IN_ADDR c)
         return (0 == splayLastResult);
     }
 
-#elif defined(_SQUID_FREEBSD_)
+#elif defined(_SQUID_FREEBSD_) || defined(_SQUID_OPENBSD_)
 
     struct arpreq arpReq;
 
@@ -625,55 +625,6 @@ aclArpCompare(acl_arp_data * const &a, acl_arp_data * const &b)
     return memcmp(a->eth, b->eth, 6);
 }
 
-#if UNUSED_CODE
-/**********************************************************************
-* This is from the pre-splay-tree code for BSD
-* I suspect the Linux approach will work on most O/S and be much
-* better - <luyer@ucs.uwa.edu.au>
-***********************************************************************
-static int
-checkARP(u_long ip, char *eth)
-{
-    int mib[6] =
-    {CTL_NET, PF_ROUTE, 0, AF_INET, NET_RT_FLAGS, RTF_LLINFO};
-    size_t needed;
-    char *buf, *next, *lim;
-    struct rt_msghdr *rtm;
-    struct sockaddr_inarp *sin;
-    struct sockaddr_dl *sdl;
-    if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) {
-       debug(28, 0) ("Can't estimate ARP table size!\n");
-       return 0;
-    }
-    if ((buf = xmalloc(needed)) == NULL) {
-       debug(28, 0) ("Can't allocate temporary ARP table!\n");
-       return 0;
-    }
-    if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
-       debug(28, 0) ("Can't retrieve ARP table!\n");
-       xfree(buf);
-       return 0;
-    }
-    lim = buf + needed;
-    for (next = buf; next < lim; next += rtm->rtm_msglen) {
-       rtm = (struct rt_msghdr *) next;
-       sin = (struct sockaddr_inarp *) (rtm + 1);
-       sdl = (struct sockaddr_dl *) (sin + 1);
-       if (sin->sin_addr.s_addr == ip) {
-           if (sdl->sdl_alen)
-               if (!memcmp(LLADDR(sdl), eth, 6)) {
-                   xfree(buf);
-                   return 1;
-               }
-           break;
-       }
-    }
-    xfree(buf);
-    return 0;
-}
-**********************************************************************/
-#endif
-
 static void
 aclDumpArpListWalkee(acl_arp_data * const &node, void *state)
 {