add NetBSD support to ARP ACL code

enable arp-acl option also for NetBSD and OpenBSD

spell the configure option for ARP ACL properly
This commit is contained in:
jdolecek 2006-12-04 21:50:53 +00:00
parent 44b3e70cb5
commit fb1f3d0016
4 changed files with 47 additions and 6 deletions

View file

@ -1,8 +1,8 @@
# $NetBSD: Makefile,v 1.184 2006/11/09 15:16:21 taca Exp $
# $NetBSD: Makefile,v 1.185 2006/12/04 21:50:53 jdolecek Exp $
DISTNAME= squid-2.6.STABLE5
PKGNAME= squid-2.6.5
#PKGREVISION= 1
PKGREVISION= 1
CATEGORIES= www
MASTER_SITES= http://www.squid-cache.org/Versions/v2/2.6/ \
ftp://ftp.leo.org/pub/comp/general/infosys/www/daemons/squid/squid-2/STABLE/ \

View file

@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.122 2006/11/09 15:16:21 taca Exp $
$NetBSD: distinfo,v 1.123 2006/12/04 21:50:53 jdolecek Exp $
SHA1 (squid-2.6.5/squid-2.6.STABLE5.tar.bz2) = 33cd0a9f4b909e80fb9e06ca7bedc62565c8d443
RMD160 (squid-2.6.5/squid-2.6.STABLE5.tar.bz2) = d2fc604f4cf6355852148e9fc01f88136988e8c2
@ -19,3 +19,4 @@ SHA1 (patch-ar) = a80477b24d02688f1f55ba1d4967bf340b5c04cb
SHA1 (patch-as) = 87cfb6190bbdaa17ffbe3a877cf6f67fde3af1f1
SHA1 (patch-bb) = 6711186c3e3e7992f9874eb47df7c0d3690649c2
SHA1 (patch-bc) = 87d67c6d00c0734eebc1d7c6a9bcd1e3331400d9
SHA1 (patch-bd) = caff973dcceaf80c9c4b9104561f4f3b0eeb7150

View file

@ -1,4 +1,4 @@
# $NetBSD: options.mk,v 1.9 2006/11/09 15:16:21 taca Exp $
# $NetBSD: options.mk,v 1.10 2006/12/04 21:50:54 jdolecek Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.squid
PKG_SUPPORTED_OPTIONS= aufs carp icmp pam-helper snmp ssl unlinkd
@ -36,7 +36,7 @@ PKG_SUGGESTED_OPTIONS+= diskd
.endif
# limited platform support arp-acl
.if !empty(OPSYS:MFreeBSD) || !empty(OPSYS:MLinux) || !empty(OPSYS:MSunOS)
.if !empty(OPSYS:MFreeBSD) || !empty(OPSYS:MNetBSD) || !empty(OPSYS:MOpenBSD) || !empty(OPSYS:MLinux) || !empty(OPSYS:MSunOS)
PKG_SUPPORTED_OPTIONS+= arp-acl
.endif
@ -63,7 +63,7 @@ CONFIGURE_ARGS+= --enable-ipf-transparent
.endif
.if !empty(PKG_OPTIONS:Marp-acl)
CONFIGURE_ARGS+= --arp-acl
CONFIGURE_ARGS+= --enable-arp-acl
.endif
.if !empty(PKG_OPTIONS:Mcarp)

View file

@ -0,0 +1,40 @@
$NetBSD: patch-bd,v 1.3 2006/12/04 21:50:54 jdolecek Exp $
--- src/acl.c.orig 2006-10-16 22:11:41.000000000 +0200
+++ src/acl.c
@@ -3083,7 +3083,7 @@ struct arpreq {
* token namespace crashing any structures or classes having members
* of the same names.
*/
-#ifdef _SQUID_OPENBSD_
+#if defined(_SQUID_NETBSD_) || defined(_SQUID_OPENBSD_)
#undef free
#endif
#include <sys/sysctl.h>
@@ -3096,7 +3096,7 @@ struct arpreq {
#include <net/route.h>
#endif
#include <net/if.h>
-#if defined(_SQUID_FREEBSD_) || defined(_SQUID_OPENBSD_)
+#if defined(_SQUID_FREEBSD_) || defined(_SQUID_NETBSD_) || defined(_SQUID_OPENBSD_)
#include <net/if_arp.h>
#endif
#if HAVE_NETINET_IF_ETHER_H
@@ -3318,7 +3318,7 @@ aclMatchArp(void *dataptr, struct in_add
inet_ntoa(c), splayLastResult ? "NOT found" : "found");
return (0 == splayLastResult);
}
-#elif defined(_SQUID_FREEBSD_) || defined(_SQUID_OPENBSD_)
+#elif defined(_SQUID_FREEBSD_) || defined(_SQUID_NETBSD_) || defined(_SQUID_OPENBSD_)
struct arpreq arpReq;
struct sockaddr_in ipAddr;
@@ -3475,7 +3475,7 @@ aclArpCompare(const void *a, const void
return (d1[4] > d2[4]) ? 1 : -1;
if (d1[5] != d2[5])
return (d1[5] > d2[5]) ? 1 : -1;
-#elif defined(_SQUID_FREEBSD_) || defined(_SQUID_OPENBSD_)
+#elif defined(_SQUID_FREEBSD_) || defined(_SQUID_OPENBSD_) || defined(_SQUID_NETBSD_)
const unsigned char *d1 = a;
const unsigned char *d2 = b;
if (d1[0] != d2[0])