tcpdump mailing list archives

Re: pcap_findalldevs() failing on FreeBSD 7.2


From: Aaron Turner <synfinatic () gmail com>
Date: Tue, 27 Oct 2009 12:00:04 -0700

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?

-- 
Aaron Turner
http://synfin.net/
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: