$NetBSD: patch-ah,v 1.2 2010/09/18 20:48:23 wiz Exp $ --- sf-gencode.c.orig 2007-11-07 07:34:18 +0100 +++ sf-gencode.c 2010-09-16 01:35:22 +0200 @@ -32,8 +32,12 @@ #include #include -#include +#ifdef __DragonFly__ +#include +#include +#else #include +#endif /* !__DragonFly__ */ #include #include @@ -44,7 +48,7 @@ #define INET6 -#include +#include "pcap-int.h" #include #include "sf-gencode.h" @@ -60,7 +64,11 @@ static char sf_errbuf[PFTOP_ERRBUF_SIZE]; /* VARARGS */ +#ifdef __DragonFly__ +void +#else __dead void +#endif sf_error(const char *fmt, ...) { va_list ap; @@ -482,8 +490,10 @@ const static int gwy_off = offsetof(pf_state_t, gwy.addr.v4); const static int ext_off = offsetof(pf_state_t, ext.addr.v4); +#if !defined(__DragonFly__) addr = ntohl(addr); mask = ntohl(mask); +#endif switch (dir) { @@ -733,13 +743,17 @@ b1 = gen_proto(IPPROTO_ESP); break; +#ifdef IPPROTO_PFSYNC case Q_PFSYNC: b1 = gen_proto(IPPROTO_PFSYNC); break; +#endif /* IPPROTO_PFSYNC */ +#ifdef IPPROTO_CARP case Q_CARP: b1 = gen_proto(IPPROTO_CARP); break; +#endif /* IPPROTO_CARP */ default: sf_error("Unknown protocol abbreviation"); @@ -756,7 +770,9 @@ const static int gwy_off = offsetof(pf_state_t, gwy.port); const static int ext_off = offsetof(pf_state_t, ext.port); +#if !defined(__DragonFly__) port = ntohs(port); +#endif switch (dir) { @@ -1560,7 +1576,7 @@ /* NOTREACHED */ } - b0 = gen_bcmp(off, strlen(ifname), ifname); + b0 = gen_bcmp(off, strlen(ifname), (const u_char *)ifname); return (b0); #else sf_error("ifname not supported in this OpenBSD release");