tcpdump mailing list archives

Re: missing/wrong headers when building libpcap under Linux 2.4.22 and glibc 2.3.2


From: "Jeremy C. Reed" <reed () reedmedia net>
Date: Thu, 9 Oct 2003 23:41:06 -0700 (PDT)

On Tue, 7 Oct 2003, Guy Harris wrote:

For some reason, libpcap-0.7.2 is not building for me with Linux 2.4.22
and glibc 2.3.2.

It first fails:

cc -O2 -O2 -I. -DHAVE_CONFIG_H -c ./pcap-snoop.c

That's not a file to be compiled on Linux.  It's a file for Irix.  Have
you ever compiled that libpcap release on Irix?  If so, do "make
distclean", re-run the configure script, and try again - in fact, even
if you haven't ever compiled it on Irix, do "make distclean", re-run the
configure script, and try again, just to make sure.

I have never tried for Irix.

Just to be sure I did a "gmake distclean" first. Then did a "./configure"
and a "gmake". It failed again the same in pcap-snoop.c

Earlier, I also tried to build the nmap-3.45/libpcap-possiblymodified
version. (It is based on old version 0.6.2.) It failed the same.

So Makefile.in has:

PSRC =  pcap-@V_PCAP@.c

So I look at configure ...

echo "configure:1604: checking packet capture type" >&5
if test ! -z "$with_pcap" ; then
        V_PCAP="$withval"
elif test -r /dev/bpf0 ; then
        V_PCAP=bpf
elif test -r /usr/include/net/pfilt.h ; then
        V_PCAP=pf
elif test -r /dev/enet ; then
        V_PCAP=enet
elif test -r /dev/nit ; then
        V_PCAP=snit
elif test -r /usr/include/sys/net/nit.h ; then
        V_PCAP=nit
elif test -r /usr/include/net/raw.h ; then
        V_PCAP=snoop

So here is the problem. My /usr/include/net/raw.h says: "An
implementation of the TCP/IP protocol suite for the LINUX ..." and
"Version:  @(#)raw.h 1.0.2 05/07/93".

Linux kernel provides asm/* and linux/* headers, but it also has net/* and
scsi/* headers. glibc also provides net/* and scsi/* headers.  glibc
doesn't provide any net/raw.h. I believe that is the problem. This system
shouldn't have /usr/include/net/raw.h. (Looking at two other Linux boxes,
I see they don't have it too.)

elif test -r /usr/include/sys/dlpi.h ; then
        V_PCAP=dlpi
elif test -r /usr/include/linux/socket.h ; then
        V_PCAP=linux

I am curious: would any system that has sys/dlpi.h or net/raw.h also have
linux/socket.h?

I haven't noticed problems with building other network related software on
this box. I don't know if this is a unique problem or if ./configure
should be patched to place the "linux" check earlier.

Thank you, Guy, for the feedback.

My libpcap-0.7.2 built and installed fine and now nmap (patched to
not build its own libpcap and) using
CONFIGURE_ARGS+=        --with-libpcap=${BUILDLINK_PREFIX.libpcap}
also worked well. (I had to get rid of the "linux" check in the configure
script too.)

   Jeremy C. Reed
   http://bsd.reedmedia.net/




-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: