mirror of
https://github.com/nmap/nmap.git
synced 2025-12-14 19:59:02 +00:00
Rearrange libpcap patch files for AIX compatibility.
The patch that moves "config.h" to the top of scanner.l (and hence scanner.c) has to happen before the files are pregenerated, otherwise there is an error on AIX: In file included from scanner.c:2792: /usr/include/unistd.h:171: error: conflicting types for 'lseek64' /usr/include/unistd.h:169: error: previous declaration of 'lseek64' was here
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
From c819d7677bafa2b8f899f50895b498275c0a6375 Mon Sep 17 00:00:00 2001
|
||||
From: David Fifield <david@bamsoftware.com>
|
||||
Date: Mon, 9 Apr 2012 19:48:21 -0700
|
||||
Subject: [PATCH 4/4] 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
|
||||
|
||||
Reference in New Issue
Block a user