mirror of
https://github.com/nmap/nmap.git
synced 2026-01-07 15:09:01 +00:00
Add a libpcap patch for compilation on Solaris 11.
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
From 4945c5795ad655f01203d3356f6fbce0ebffdfc4 Mon Sep 17 00:00:00 2001
|
||||
From: David Fifield <david@bamsoftware.com>
|
||||
Date: Mon, 9 Apr 2012 19:48:21 -0700
|
||||
Subject: [PATCH 5/5] Include <netpacket/packet.h> before "pcap/bpf.h".
|
||||
|
||||
On Solaris 11, <netpacket/packet.h> includes <net/bpf.h>, 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 <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 */
|
||||
|
||||
+#include "pcap-int.h"
|
||||
+
|
||||
+#ifdef HAVE_OS_PROTO_H
|
||||
+#include "os-proto.h"
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* This is fun.
|
||||
*
|
||||
--
|
||||
1.7.9.5
|
||||
|
||||
@@ -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 */
|
||||
|
||||
#include "pcap-int.h"
|
||||
|
||||
#ifdef HAVE_OS_PROTO_H
|
||||
#include "os-proto.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This is fun.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user