tech-userlevel archive

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

tcpdump -D not working by default



Hello,

tcpdump(1)'s -D option (list available network interfaces) is available
on NetBSD 4, but not on NetBSD 3 and -current. Reasons:

- On NetBSD 3 tcpdump does'n not enable HAVE_PCAP_FINDALLDEVS. Is there
  any particular reason for this? It seems to work just fine...

- On -current this probably went missing while tcpdump 3.9.7 was merged:
  while HAVE_PCAP_FINDALLDEVS is enabled, HAVE_PCAP_IF_T is not - but
  the latter is also needed, otherwise the former gets undefined in
  tcpdump.c.

The attached patches fix the problem. Any comments?


Cheers, Jukka

-- 
bashian roulette:
$ ((RANDOM%6)) || rm -rf ~
Index: usr.sbin/tcpdump/Makefile
===================================================================
RCS file: /cvsroot/src/usr.sbin/tcpdump/Makefile,v
retrieving revision 1.45
diff -u -p -r1.45 Makefile
--- usr.sbin/tcpdump/Makefile   24 Jul 2007 12:01:00 -0000      1.45
+++ usr.sbin/tcpdump/Makefile   7 Jan 2008 11:00:35 -0000
@@ -66,7 +66,7 @@ CPPFLAGS+= \
        -DHAVE_SOCKADDR_SA_LEN=1 -DHAVE_H_ERRNO=1 -DHAVE_OPENSSL_EVP_H=1 \
        -DHAVE_PCAP_LIB_VERSION=1 -DHAVE_PCAP_SET_DATALINK=1 \
        -DHAVE_PCAP_LIST_DATALINKS=1 -DHAVE_PCAP_DATALINK_NAME_TO_VAL=1 \
-       -DHAVE_PCAP_FINDALLDEVS=1 -DHAVE_PCAP_DUMP_FLUSH=1 \
+       -DHAVE_PCAP_FINDALLDEVS=1 -DHAVE_PCAP_IF_T=1 -DHAVE_PCAP_DUMP_FLUSH=1 \
        -DHAVE_PCAP_DEBUG=1
 CPPFLAGS+= -DHAVE_STRUCT_ETHER_ADDR
 CPPFLAGS+=-DLBL_ALIGN=1
Index: usr.sbin/tcpdump/Makefile
===================================================================
RCS file: /cvsroot/src/usr.sbin/tcpdump/Makefile,v
retrieving revision 1.39
diff -u -p -r1.39 Makefile
--- usr.sbin/tcpdump/Makefile   9 Mar 2005 03:11:23 -0000       1.39
+++ usr.sbin/tcpdump/Makefile   7 Jan 2008 11:42:56 -0000
@@ -59,7 +59,8 @@ CPPFLAGS+= \
        -DHAVE_SETLINEBUF=1 -DHAVE_VSNPRINTF=1 -DHAVE_SNPRINTF=1 \
        -DRETSIGTYPE=void -DRETSIGVAL= -DHAVE_SIGACTION=1 \
        -DHAVE_SOCKADDR_SA_LEN=1 -DHAVE_H_ERRNO=1 -DHAVE_OPENSSL_EVP_H=1 \
-       -DHAVE_PCAP_LIB_VERSION=1 -DHAVE_PCAP_SET_DATALINK=1
+       -DHAVE_PCAP_LIB_VERSION=1 -DHAVE_PCAP_SET_DATALINK=1 \
+       -DHAVE_PCAP_FINDALLDEVS=1
 CPPFLAGS+=-DLBL_ALIGN=1
 CPPFLAGS+=-DTCPDUMP_DO_SMB=1
 CPPFLAGS+=-D_U_="__attribute__((unused))"


Home | Main Index | Thread Index | Old Index