[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libpcap0.8-dev bug?

wackamole FTBFS because it wasn't finding libpcap (I guess it might
now FTBFS on Linux architectures too but that's another story) but on
my porter box (where it's installed), configure then runs
fine. However, I'm now running into:
| kibi@kbsd:~/hack/wackamole-2.1.1$ make
| cc -g -O2 -g -Wall -O2 -Wall  -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64  -I/usr/lib/perl/5.10/CORE  -D_REENTRANT -I. -I.  -I/usr/include -DETCDIR=\"/etc\" -D_PATH_WACKAMOLE_PIDDIR=\"/var/run/wackamole\" -DBUNDLEEXT=\"\" -DHAVE_CONFIG_H -c wackamole.c
| In file included from defines.h:57,
|                  from config.h:294,
|                  from wackamole.c:36:
| /usr/include/net/bpf.h:63: error: redefinition of 'struct bpf_program'
| /usr/include/net/bpf.h:87: error: redefinition of 'struct bpf_version'
| /usr/include/net/bpf.h:743: error: redefinition of 'struct bpf_insn'

Those structures are indeed defined in both headers:
| /usr/include/net/bpf.h
| /usr/include/pcap/bpf.h

I guess I should be opening a bug against the package containing the
latter since it probably should check for _NET_BPF_H_ before trying to
define those, which is the #define guarding the net/bpf.h header.

I'd like to read your thoughts about that, though.

I am unsure. There are two headers which provide similar funcionality and application should choose only one of them. It should either directly use ioctls (<net/bpf.h>) or library calls (<pcap/bpf.h>).

The wackamole in fact should not require libpcap on any platform, the patch bellow suffices for a build in an environment w/o libpcap-dev.

The problem in xprobe is in libs-external/USI++/src/configure.in,
there should not be -DIMMEDIATE for us.

IMHO, at most wishlist bug requesting posibility of include both
<net/bpf.h> and <pcap/bpf.h> in any order.


only in patch2:
--- wackamole-2.1.1.orig/configure.in
+++ wackamole-2.1.1/configure.in
@@ -331,8 +331,6 @@
   if test -c "/dev/bpf0" ; then
-        AC_CHECK_LIB(pcap, pcap_strerror, ,
-               AC_MSG_ERROR([ *** Need libpcap for BPF ***]))
only in patch2:
--- wackamole-2.1.1.orig/ife-bpf.c
+++ wackamole-2.1.1/ife-bpf.c
@@ -33,7 +33,7 @@
     _if_bpf = open(device, O_WRONLY);
   } while (_if_bpf < 0 && errno == EBUSY && n < 999);
   if(_if_bpf < 0) {
-    printf("%s: %s", device, (const char *)pcap_strerror(errno));
+    printf("%s: %s", device, (const char *)strerror(errno));
     exit (EXIT_FAILURE);
   v = 32768;

Reply to: