diff --git a/libpcap/NMAP_MODIFICATIONS/0005-Include-netpacket-packet.h-before-pcap-bpf.h.patch b/libpcap/NMAP_MODIFICATIONS/0005-Include-netpacket-packet.h-before-pcap-bpf.h.patch new file mode 100644 index 000000000..4a6a112bb --- /dev/null +++ b/libpcap/NMAP_MODIFICATIONS/0005-Include-netpacket-packet.h-before-pcap-bpf.h.patch @@ -0,0 +1,58 @@ +From 4945c5795ad655f01203d3356f6fbce0ebffdfc4 Mon Sep 17 00:00:00 2001 +From: David Fifield +Date: Mon, 9 Apr 2012 19:48:21 -0700 +Subject: [PATCH 5/5] Include before "pcap/bpf.h". + +On Solaris 11, includes , which defines +the symbols bpf_program and bpf_insn. The included "pcap/bpf.h" also +includes these symbols, and checks whether any bpf.h has already been +included; if so, it doesn't include itself. When the includes go in the +other order there is no such guard. This is the error I get on Solaris +11: + +gcc -O2 -fpic -I. -DHAVE_CONFIG_H -D_U_="__attribute__((unused))" -g -O2 -c ./fad-getad.c +In file included from /usr/include/netpacket/packet.h:10:0, + from ./fad-getad.c:66: +/usr/include/net/bpf.h:73:8: error: redefinition of 'struct bpf_program' +./pcap/bpf.h:107:8: note: originally defined here +In file included from /usr/include/netpacket/packet.h:10:0, + from ./fad-getad.c:66: +/usr/include/net/bpf.h:253:8: error: redefinition of 'struct bpf_insn' +./pcap/bpf.h:109:9: note: originally defined here +--- + fad-getad.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +diff --git fad-getad.c fad-getad.c +index 742ae1f..519893a 100644 +--- fad-getad.c ++++ fad-getad.c +@@ -54,12 +54,6 @@ static const char rcsid[] _U_ = + #include + #include + +-#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 */ + ++#include "pcap-int.h" ++ ++#ifdef HAVE_OS_PROTO_H ++#include "os-proto.h" ++#endif ++ + /* + * This is fun. + * +-- +1.7.9.5 + diff --git a/libpcap/fad-getad.c b/libpcap/fad-getad.c index 742ae1fac..519893ac9 100644 --- a/libpcap/fad-getad.c +++ b/libpcap/fad-getad.c @@ -54,12 +54,6 @@ static const char rcsid[] _U_ = #include #include -#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 */ +#include "pcap-int.h" + +#ifdef HAVE_OS_PROTO_H +#include "os-proto.h" +#endif + /* * This is fun. *