Nmap Development mailing list archives

Build fails on system with ancient version of libpcap installed


From: Paul Howarth <paul () city-fan org>
Date: Mon, 31 Jan 2011 13:24:40 +0000

Trying to build nmap - with the bundled libpcap - fails on systems with ancient versions of libpcap (e.g. 0.7.2) installed:

$  ./configure \
        --with-liblua=included \
        --with-libpcap=included \
        --without-nping
...
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,
                 from nsock_pcap.h:7,
                 from nsock_pcap.c:12:
../../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?

Cheers, Paul.
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: