diff options
Diffstat (limited to 'net/libpcap/patches')
-rw-r--r-- | net/libpcap/patches/patch-aa | 17 | ||||
-rw-r--r-- | net/libpcap/patches/patch-ac | 62 | ||||
-rw-r--r-- | net/libpcap/patches/patch-ad | 41 | ||||
-rw-r--r-- | net/libpcap/patches/patch-configure | 75 | ||||
-rw-r--r-- | net/libpcap/patches/patch-gencode.c | 24 | ||||
-rw-r--r-- | net/libpcap/patches/patch-pcap-libdlpi.c | 18 |
6 files changed, 187 insertions, 50 deletions
diff --git a/net/libpcap/patches/patch-aa b/net/libpcap/patches/patch-aa deleted file mode 100644 index 135e5ff8ad6..00000000000 --- a/net/libpcap/patches/patch-aa +++ /dev/null @@ -1,17 +0,0 @@ -$NetBSD: patch-aa,v 1.7 2011/02/11 12:11:26 adam Exp $ - ---- pcap/pcap.h.orig 2008-10-29 15:08:55.000000000 +0100 -+++ pcap/pcap.h -@@ -349,10 +349,12 @@ void pcap_freealldevs(pcap_if_t *); - const char *pcap_lib_version(void); - - /* XXX this guy lives in the bpf tree */ -+#ifndef _NET_BPF_H_ - u_int bpf_filter(const struct bpf_insn *, const u_char *, u_int, u_int); - int bpf_validate(const struct bpf_insn *f, int len); - char *bpf_image(const struct bpf_insn *, int); - void bpf_dump(const struct bpf_program *, int); -+#endif - - #if defined(WIN32) - diff --git a/net/libpcap/patches/patch-ac b/net/libpcap/patches/patch-ac index 0251bd60a56..ef5e3c313c7 100644 --- a/net/libpcap/patches/patch-ac +++ b/net/libpcap/patches/patch-ac @@ -1,6 +1,6 @@ -$NetBSD: patch-ac,v 1.7 2012/06/27 10:53:40 fhajny Exp $ +$NetBSD: patch-ac,v 1.8 2013/02/06 18:07:04 jperkin Exp $ ---- Makefile.in.orig 2010-04-05 17:54:05.000000000 +0000 +--- Makefile.in.orig 2012-03-29 12:57:32.000000000 +0000 +++ Makefile.in @@ -45,7 +45,7 @@ VPATH = @srcdir@ # @@ -8,10 +8,10 @@ $NetBSD: patch-ac,v 1.7 2012/06/27 10:53:40 fhajny Exp $ LD = /usr/bin/ld -CC = @CC@ +CC = ${LIBTOOL} --mode=compile @CC@ + AR = @AR@ CCOPT = @V_CCOPT@ INCLS = -I. @V_INCLS@ - DEFS = @DEFS@ @V_DEFS@ -@@ -76,7 +76,8 @@ YACC = @V_YACC@ +@@ -78,7 +78,8 @@ YACC = @V_YACC@ # Explicitly define compilation rule since SunOS 4's make doesn't like gcc. # Also, gcc does not remove the .o before forking 'as', which can be a # problem if you don't own the file but can write to the directory. @@ -19,9 +19,9 @@ $NetBSD: patch-ac,v 1.7 2012/06/27 10:53:40 fhajny Exp $ +.SUFFIXES: .lo +.c.lo: @rm -f $@ - $(CC) $(CFLAGS) -c $(srcdir)/$*.c + $(CC) $(FULL_CFLAGS) -c $(srcdir)/$*.c -@@ -87,13 +88,13 @@ CSRC = pcap.c inet.c gencode.c optimize. +@@ -89,13 +90,13 @@ CSRC = pcap.c inet.c gencode.c optimize. savefile.c sf-pcap.c sf-pcap-ng.c pcap-common.c \ bpf_image.c bpf_dump.c GENSRC = scanner.c grammar.c bpf_filter.c version.c @@ -37,7 +37,7 @@ $NetBSD: patch-ac,v 1.7 2012/06/27 10:53:40 fhajny Exp $ PUBHDR = \ pcap.h \ pcap-bpf.h \ -@@ -324,12 +325,10 @@ EXTRA_DIST = \ +@@ -345,12 +346,10 @@ EXTRA_DIST = \ Win32/Src/inet_net.c \ Win32/Src/inet_pton.c @@ -46,49 +46,49 @@ $NetBSD: patch-ac,v 1.7 2012/06/27 10:53:40 fhajny Exp $ -libpcap.a: $(OBJ) - @rm -f $@ -- ar rc $@ $(OBJ) $(ADDLARCHIVEOBJS) +- $(AR) rc $@ $(OBJ) $(ADDLARCHIVEOBJS) - $(RANLIB) $@ +libpcap.la: $(OBJ) + ${LIBTOOL} --mode=link @CC@ -rpath ${PREFIX}/lib ${LDFLAGS} $(OBJ) $(LIBS) -o libpcap.la shared: libpcap.$(DYEXT) -@@ -413,10 +412,10 @@ scanner.c: $(srcdir)/scanner.l +@@ -434,10 +433,10 @@ scanner.c: $(srcdir)/scanner.l @rm -f $@ $(srcdir)/runlex.sh $(LEX) -o$@ $< -scanner.o: scanner.c tokdefs.h +scanner.lo: scanner.c tokdefs.h - $(CC) $(CFLAGS) -c scanner.c + $(CC) $(FULL_CFLAGS) -c scanner.c -pcap.o: version.h +pcap.lo: version.h tokdefs.h: grammar.c grammar.c: $(srcdir)/grammar.y -@@ -425,17 +424,17 @@ grammar.c: $(srcdir)/grammar.y +@@ -446,17 +445,17 @@ grammar.c: $(srcdir)/grammar.y mv y.tab.c grammar.c mv y.tab.h tokdefs.h -grammar.o: grammar.c +grammar.lo: grammar.c @rm -f $@ - $(CC) $(CFLAGS) -Dyylval=pcap_lval -c grammar.c + $(CC) $(FULL_CFLAGS) -Dyylval=pcap_lval -c grammar.c -version.o: version.c +version.lo: version.c - $(CC) $(CFLAGS) -c version.c + $(CC) $(FULL_CFLAGS) -c version.c -snprintf.o: $(srcdir)/missing/snprintf.c +snprintf.lo: $(srcdir)/missing/snprintf.c - $(CC) $(CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c + $(CC) $(FULL_CFLAGS) -o $@ -c $(srcdir)/missing/snprintf.c -version.c: $(srcdir)/VERSION +version.c: #$(srcdir)/VERSION @rm -f $@ if grep GIT ${srcdir}/VERSION >/dev/null; then \ read ver <${srcdir}/VERSION; \ -@@ -452,7 +451,7 @@ version.c: $(srcdir)/VERSION +@@ -473,7 +472,7 @@ version.c: $(srcdir)/VERSION # so we make the version string static and return it from # a function, which does work. # @@ -97,25 +97,25 @@ $NetBSD: patch-ac,v 1.7 2012/06/27 10:53:40 fhajny Exp $ @rm -f $@ if grep GIT ${srcdir}/VERSION >/dev/null; then \ read ver <${srcdir}/VERSION; \ -@@ -466,7 +465,7 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt +@@ -487,7 +486,7 @@ bpf_filter.c: $(srcdir)/bpf/net/bpf_filt rm -f bpf_filter.c ln -s $(srcdir)/bpf/net/bpf_filter.c bpf_filter.c -bpf_filter.o: bpf_filter.c +bpf_filter.lo: bpf_filter.c - $(CC) $(CFLAGS) -c bpf_filter.c + $(CC) $(FULL_CFLAGS) -c bpf_filter.c # -@@ -497,7 +496,7 @@ selpolltest: selpolltest.c libpcap.a - opentest: opentest.c libpcap.a - $(CC) $(CFLAGS) -I. -L. -o opentest $(srcdir)/opentest.c libpcap.a $(LIBS) +@@ -530,7 +529,7 @@ opentest: tests/opentest.c libpcap.a + selpolltest: tests/selpolltest.c libpcap.a + $(CC) $(FULL_CFLAGS) -I. -L. -o selpolltest $(srcdir)/tests/selpolltest.c libpcap.a $(LIBS) -install: install-shared install-archive pcap-config +install: libpcap.la pcap-config [ -d $(DESTDIR)$(libdir) ] || \ (mkdir -p $(DESTDIR)$(libdir); chmod 755 $(DESTDIR)$(libdir)) [ -d $(DESTDIR)$(includedir) ] || \ -@@ -512,48 +511,49 @@ install: install-shared install-archive +@@ -545,57 +544,58 @@ install: install-shared install-archive (mkdir -p $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_FILE_FORMATS@) [ -d $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@ ] || \ (mkdir -p $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@; chmod 755 $(DESTDIR)$(mandir)/man@MAN_MISC_INFO@) @@ -126,7 +126,7 @@ $NetBSD: patch-ac,v 1.7 2012/06/27 10:53:40 fhajny Exp $ [ -d $(DESTDIR)$(bindir) ] || \ (mkdir -p $(DESTDIR)$(bindir); chmod 755 $(DESTDIR)$(bindir)) - $(INSTALL_PROGRAM) pcap-config $(DESTDIR)$(bindir)/pcap-config -+ ${BSD_INSTALL_SCRIPT} pcap-config $(DESTDIR)$(bindir)/pcap-config ++ $(BSD_INSTALL_SCRIPT) pcap-config $(DESTDIR)$(bindir)/pcap-config for i in $(MAN1); do \ $(INSTALL_DATA) $(srcdir)/$$i \ $(DESTDIR)$(mandir)/man1/$$i; done @@ -146,12 +146,21 @@ $NetBSD: patch-ac,v 1.7 2012/06/27 10:53:40 fhajny Exp $ - rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap - ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3pcap \ - $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3pcap +- rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap +- ln $(DESTDIR)$(mandir)/man3/pcap_findalldevs.3pcap \ +- $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3pcap - rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap - ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3pcap \ - $(DESTDIR)$(mandir)/man3/pcap_perror.3pcap - rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap - ln $(DESTDIR)$(mandir)/man3/pcap_inject.3pcap \ - $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3pcap +- rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap +- ln $(DESTDIR)$(mandir)/man3/pcap_list_datalinks.3pcap \ +- $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3pcap +- rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap +- ln $(DESTDIR)$(mandir)/man3/pcap_list_tstamp_types.3pcap \ +- $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3pcap - rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap - ln $(DESTDIR)$(mandir)/man3/pcap_loop.3pcap \ - $(DESTDIR)$(mandir)/man3/pcap_dispatch.3pcap @@ -173,12 +182,21 @@ $NetBSD: patch-ac,v 1.7 2012/06/27 10:53:40 fhajny Exp $ + rm -f $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3 + ln $(DESTDIR)$(mandir)/man3/pcap_dump_open.3 \ + $(DESTDIR)$(mandir)/man3/pcap_dump_fopen.3 ++ rm -f $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3 ++ ln $(DESTDIR)$(mandir)/man3/pcap_findalldevs.3 \ ++ $(DESTDIR)$(mandir)/man3/pcap_freealldevs.3 + rm -f $(DESTDIR)$(mandir)/man3/pcap_perror.3 + ln $(DESTDIR)$(mandir)/man3/pcap_geterr.3 \ + $(DESTDIR)$(mandir)/man3/pcap_perror.3 + rm -f $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3 + ln $(DESTDIR)$(mandir)/man3/pcap_inject.3 \ + $(DESTDIR)$(mandir)/man3/pcap_sendpacket.3 ++ rm -f $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3 ++ ln $(DESTDIR)$(mandir)/man3/pcap_list_datalinks.3 \ ++ $(DESTDIR)$(mandir)/man3/pcap_free_datalinks.3 ++ rm -f $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3 ++ ln $(DESTDIR)$(mandir)/man3/pcap_list_tstamp_types.3 \ ++ $(DESTDIR)$(mandir)/man3/pcap_free_tstamp_types.3 + rm -f $(DESTDIR)$(mandir)/man3/pcap_dispatch.3 + ln $(DESTDIR)$(mandir)/man3/pcap_loop.3 \ + $(DESTDIR)$(mandir)/man3/pcap_dispatch.3 diff --git a/net/libpcap/patches/patch-ad b/net/libpcap/patches/patch-ad index a5ee0146d71..607e49579b8 100644 --- a/net/libpcap/patches/patch-ad +++ b/net/libpcap/patches/patch-ad @@ -1,13 +1,32 @@ -$NetBSD: patch-ad,v 1.5 2011/09/14 17:30:04 hans Exp $ +$NetBSD: patch-ad,v 1.6 2013/02/06 18:07:04 jperkin Exp $ ---- fad-getad.c.orig 2010-04-05 19:54:05.000000000 +0200 -+++ fad-getad.c 2011-07-28 20:28:17.246289360 +0200 -@@ -60,7 +60,7 @@ static const char rcsid[] _U_ = - #include "os-proto.h" - #endif +* Re-order includes to avoid bpf_program re-definition. + +--- fad-getad.c.orig 2012-03-29 12:57:32.000000000 +0000 ++++ fad-getad.c +@@ -54,12 +54,6 @@ static const char rcsid[] _U_ = + #include <string.h> + #include <ifaddrs.h> + +-#include "pcap-int.h" +- +-#ifdef HAVE_OS_PROTO_H +-#include "os-proto.h" +-#endif +- + #ifdef AF_PACKET + # ifdef HAVE_NETPACKET_PACKET_H + /* Solaris 11 and later, Linux distributions with newer glibc */ +@@ -77,6 +71,12 @@ static const char rcsid[] _U_ = + # endif /* HAVE_NETPACKET_PACKET_H */ + #endif /* AF_PACKET */ --#ifdef AF_PACKET -+#if defined(AF_PACKET) && !defined(__sun) - # ifdef __Lynx__ - /* LynxOS */ - # include <netpacket/if_packet.h> ++#include "pcap-int.h" ++ ++#ifdef HAVE_OS_PROTO_H ++#include "os-proto.h" ++#endif ++ + /* + * This is fun. + * diff --git a/net/libpcap/patches/patch-configure b/net/libpcap/patches/patch-configure new file mode 100644 index 00000000000..8950bf56f67 --- /dev/null +++ b/net/libpcap/patches/patch-configure @@ -0,0 +1,75 @@ +$NetBSD: patch-configure,v 1.1 2013/02/06 18:07:04 jperkin Exp $ + +* Fix sys/bufmod.h and linking issues on Solaris. +* Use standard manpage layout on all platforms. + +--- configure.orig 2012-03-29 12:57:32.000000000 +0000 ++++ configure +@@ -5225,6 +5225,20 @@ dlpi) + # Also, due to the bug above applications that link to libpcap with + # libdlpi will have to add "-L/lib" option to "configure". + # ++ for ac_header in sys/bufmod.h sys/dlpi_ext.h ++do : ++ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ++ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" ++if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : ++ cat >>confdefs.h <<_ACEOF ++#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 ++_ACEOF ++ ++fi ++ ++done ++ SSRC="dlpisubs.c" ++ + saved_ldflags=$LDFLAGS + LDFLAGS="$LIBS -L/lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlpi_walk in -ldlpi" >&5 +@@ -5763,19 +5777,6 @@ else + case "$V_PCAP" in + + dlpi|libdlpi) +- for ac_header in sys/bufmod.h sys/dlpi_ext.h +-do : +- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : +- cat >>confdefs.h <<_ACEOF +-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +-_ACEOF +- +-fi +- +-done +- + # + # This might be Solaris 8 or later, with + # SIOCGLIFCONF, or it might be some other OS +@@ -5820,7 +5821,6 @@ $as_echo "$ac_cv_lbl_have_siocglifconf" + # + # Needed for common functions used by pcap-[dlpi,libdlpi].c + # +- SSRC="dlpisubs.c" + ;; + + *) +@@ -6688,8 +6688,6 @@ fi + # Individual cases can override this. + # + DYEXT="none" +-MAN_FILE_FORMATS=5 +-MAN_MISC_INFO=7 + case "$host_os" in + + aix*) +@@ -6916,6 +6914,9 @@ $as_echo "#define HAVE_SOLARIS 1" >>conf + ;; + esac + ++MAN_FILE_FORMATS=5 ++MAN_MISC_INFO=7 ++ + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. + set dummy ${ac_tool_prefix}ranlib; ac_word=$2 diff --git a/net/libpcap/patches/patch-gencode.c b/net/libpcap/patches/patch-gencode.c new file mode 100644 index 00000000000..29c2252fdbd --- /dev/null +++ b/net/libpcap/patches/patch-gencode.c @@ -0,0 +1,24 @@ +$NetBSD: patch-gencode.c,v 1.1 2013/02/06 18:07:04 jperkin Exp $ + +* Correctly limit Linux interfaces to Linux-only. + +--- gencode.c.orig 2012-06-12 16:55:36.000000000 +0000 ++++ gencode.c +@@ -84,7 +84,7 @@ static const char rcsid[] _U_ = + #include "pcap/sll.h" + #include "pcap/ipnet.h" + #include "arcnet.h" +-#if defined(PF_PACKET) && defined(SO_ATTACH_FILTER) ++#if defined(linux) && defined(PF_PACKET) && defined(SO_ATTACH_FILTER) + #include <linux/types.h> + #include <linux/if_packet.h> + #include <linux/filter.h> +@@ -7583,7 +7583,7 @@ gen_inbound(dir) + * check it, otherwise give up as this link-layer type + * has nothing in the packet data. + */ +-#if defined(PF_PACKET) && defined(SO_ATTACH_FILTER) ++#if defined(linux) && defined(PF_PACKET) && defined(SO_ATTACH_FILTER) + /* + * We infer that this is Linux with PF_PACKET support. + * If this is a *live* capture, we can look at diff --git a/net/libpcap/patches/patch-pcap-libdlpi.c b/net/libpcap/patches/patch-pcap-libdlpi.c new file mode 100644 index 00000000000..9b405154472 --- /dev/null +++ b/net/libpcap/patches/patch-pcap-libdlpi.c @@ -0,0 +1,18 @@ +$NetBSD: patch-pcap-libdlpi.c,v 1.1 2013/02/06 18:07:04 jperkin Exp $ + +* Fix compile on Solaris. + +--- pcap-libdlpi.c.orig 2012-03-29 12:57:32.000000000 +0000 ++++ pcap-libdlpi.c +@@ -235,9 +235,9 @@ bad: + static int + dlpromiscon(pcap_t *p, bpf_u_int32 level) + { +- int err; ++ int err, retv; + +- retv = dlpi_promiscon(p->hd, level); ++ retv = dlpi_promiscon(p->dlpi_hd, level); + if (retv != DLPI_SUCCESS) { + if (retv == DL_SYSERR && + (errno == EPERM || errno == EACCES)) |