tcpdump mailing list archives

Re: pcap_findalldevs() failing on FreeBSD 7.2


From: Wesley Shields <wxs () FreeBSD org>
Date: Wed, 28 Oct 2009 10:57:33 -0400

On Tue, Oct 27, 2009 at 12:00:04PM -0700, Aaron Turner wrote:
On Tue, Oct 27, 2009 at 11:55 AM, Jung-uk Kim <jkim () freebsd org> wrote:
On Friday 25 September 2009 01:18 am, Aaron Turner wrote:
I've got a user of tcpreplay having issues where his interfaces are
not being returned via pcap_findalldevs() under FreeBSD 7.2 using
libpcap 0.9.7. ?I don't have much more information unfortunately,
but I do know he has an "nVIDIA nForce 10/100/1000 Ethernet" NIC as
well as the obvious loopback.

I've confirmed he is running as root and the interface is up:

nfe0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0
mtu 1500
options=19b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4>
ether 00:1e:8c:b1:de:91
? ? ? ? inet 192.168.1.111 netmask 0xffffff00 broadcast
192.168.1.255 media: Ethernet autoselect (100baseTX
<full-duplex,flag0,flag1>) status: active

Actually, none of his interfaces are being returned (nfe0, nfe1 and
lo0). ?I looked in the change log and don't see any mention of any
improvements/fixes in pcap_finalldevs() since 0.9.7 so I figured
I'd mention it.

It's working fine for me:

%uname -mrs
FreeBSD 9.0-CURRENT amd64
%tcpdump -D
1.re0
2.lo0
%tcpdump -c 10 -w /dev/null
tcpdump: listening on re0, link-type EN10MB (Ethernet), capture size
96 bytes
10 packets captured
18 packets received by filter
0 packets dropped by kernel

Note "tcpdump -D" is using pcap_findalldevs() as well:

tcpdump.c:
--------------------------------------------------
#ifdef HAVE_PCAP_FINDALLDEVS
? ?case 'D':
? ? ? ?if (pcap_findalldevs(&devpointer, ebuf) < 0)
? ? ? ? ? ?error("%s", ebuf);
? ? ? ?else {
? ? ? ? ? ?for (i = 0; devpointer != 0; i++) {
? ? ? ? ? ? ? ?printf("%d.%s", i+1, devpointer->name);
? ? ? ? ? ? ? ?if (devpointer->description != NULL)
? ? ? ? ? ? ? ? ? ?printf(" (%s)", devpointer->description);
? ? ? ? ? ? ? ?printf("\n");
? ? ? ? ? ? ? ?devpointer = devpointer->next;
? ? ? ? ? ?}
? ? ? ?}
? ? ? ?return 0;
--------------------------------------------------

Jung-uk Kim


I notice you're using FreeBSD 9.0... what version of libpcap?  I
wonder if this is a libpcap bug or something in FreeBSD?

I have two machines with identical hardware. They both have an nfe and
bge interface. I don't use the nfe one at all.

wxs@syn wxs % uname -sr
FreeBSD 7.1-RELEASE-p5
wxs@syn wxs % ifconfig -l
bge0 fwe0 fwip0 nfe0 lo0 pflog0
wxs@syn wxs % ifconfig nfe0
nfe0: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=10b<RXCSUM,TXCSUM,VLAN_MTU,TSO4>
        ether 00:e0:81:5b:6b:4f
        media: Ethernet autoselect (none)
        status: no carrier
wxs@syn wxs % sudo tcpdump -D
1.bge0
2.lo0
wxs@syn wxs % sudo ifconfig nfe0 192.168.3.100/24
wxs@syn wxs % sudo tcpdump -D                    
1.bge0
2.nfe0
3.lo0
wxs@syn wxs % tcpdump -V
tcpdump version 3.9.8
libpcap version 0.9.8

I get the same results on a 9-CURRENT machine.

That is with tcpdump version 4.0.0 and libpcap version 1.0.0.

-- WXS
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: