net/bpf.h issue
Joerg Anslik
joerg at anslik.de
Sat Mar 19 03:22:13 PST 2005
Hi,
I think there's a flaw in our net/bpf.h when pcap.h is also included;
I just came accross this when trying to compile "hping" from ports:
----------
In file included from libpcap_stuff.c:20:
/usr/include/net/bpf.h:58: warning: `BPF_ALIGNMENT' redefined
/usr/include/pcap-bpf.h:71: warning: this is the location of the
previous definition
/usr/include/net/bpf.h:62: warning: `BPF_MAXBUFSIZE' redefined
/usr/include/pcap-bpf.h:78: warning: this is the location of the
previous definition
/usr/include/net/bpf.h:173: warning: `DLT_SLIP_BSDOS' redefined
/usr/include/pcap-bpf.h:161: warning: this is the location of the
previous definition
/usr/include/net/bpf.h:174: warning: `DLT_PPP_BSDOS' redefined
/usr/include/pcap-bpf.h:162: warning: this is the location of the
previous definition
In file included from libpcap_stuff.c:20:
/usr/include/net/bpf.h:51: redefinition of `bpf_int32'
/usr/include/pcap-bpf.h:63: `bpf_int32' previously declared here
/usr/include/net/bpf.h:52: redefinition of `bpf_u_int32'
/usr/include/pcap-bpf.h:64: `bpf_u_int32' previously declared here
/usr/include/net/bpf.h:69: redefinition of `struct bpf_program'
/usr/include/net/bpf.h:93: redefinition of `struct bpf_version'
/usr/include/net/bpf.h:338: redefinition of `struct bpf_insn'
----------
Compiling a short test code like
#include <pcap.h>
#include <net/bpf.h>
main(){}
produces the same errors. I got rid of this by including a few
"#ifndef ..." statements in net/bpf.h, but I didn't take a closer look
at the overall stuff, so I'm not quite sure if this is the right
place.
If it is, however, I can submit my patch, if it's not, just point me
in the right direction and I'll fix it there. (I just wanted to get
hping running, so... :)
--j
-----------------------------------------------------
who | grep -i blonde | talk; cd ~; wine; talk; touch;
unzip; touch; strip; gasp; finger; gasp; mount;
fsck; more; yes; gasp; umount; make clean; sleep
More information about the Bugs
mailing list