mailing list archives
Re: Build fails on system with ancient version of libpcap installed
From: David Fifield <david () bamsoftware com>
Date: Tue, 1 Feb 2011 13:40:51 -0800
On Mon, Jan 31, 2011 at 01:24:40PM +0000, Paul Howarth wrote:
Trying to build nmap - with the bundled libpcap - fails on systems
with ancient versions of libpcap (e.g. 0.7.2) installed:
$ ./configure \
gcc -c -I/usr/kerberos/include -I../../nbase -DHAVE_CONFIG_H
-DNSOCK_VERSION=\"0.02\" -D_FORTIFY_SOURCE=2 -I../include
-I../../libpcap -O2 -g -pipe -march=i386 -mcpu=i686 -Wall
nsock_pcap.c -o nsock_pcap.o
In file included from ../../libpcap/pcap.h:45,
../../libpcap/pcap/pcap.h:352: error: conflicting types for `bpf_filter'
/usr/include/net/bpf.h:448: error: previous declaration of `bpf_filter'
../../libpcap/pcap/pcap.h:353: error: conflicting types for `bpf_validate'
/usr/include/net/bpf.h:447: error: previous declaration of `bpf_validate'
What's happening here is that nsock's configure script is checking
for <net/bpf.h> and finding it on the system, despite the fact that
we're using the bundled libpcap, which doesn't supply that obsolete
header file. So the old system libpcap header files are included in
addition to the much newer bundled libpcap header files and we get
the conflict above.
A simple workaround for me was to tell the configure script that we
don't have <net/bpf.h>:
$ export ac_cv_header_net_bpf_h=no
$ ./configure ...
Perhaps the configure script could be tweaked not to check for this
header if the included libpcap is being used in future versions?
Thanks for good analysis. Since you've looked into this already, could
you suggest how to make this change (or provide a patch)? That spares
someone from having to simulate or install an old libpcap to test the
Sent through the nmap-dev mailing list
Archived at http://seclists.org/nmap-dev/