tcpdump mailing list archives

Re: libpcap: patches required for OpenSolaris/SXCE


From: Guy Harris <guy () alum mit edu>
Date: Tue, 1 Dec 2009 19:13:33 -0800


On Dec 1, 2009, at 7:06 PM, Sebastien Roy wrote:

bash-3.2# tcpdump -i bge0
tcpdump: WARNING: SIOCGIFADDR: bge0: No such device or address

This means "sorry, if you're expecting -f to work or a filter
containing 'ip broadcast' to work, you're going to be disappointed".

Why not say exactly that?

Because pcap_lookupnet() doesn't know how to distinguish between "there's no such interface at all", "there is such an interface but it has no IPv4 address", and "something else happened". What's the right way to do so on Solaris?

Does the errno corresponding to "No such device or address", when
returned by ioctl(SIOCGIFADDR), mean "this device doesn't have an
address of the type"?  Or can it also mean "there is no such device"?

It means that there is no IP interface named bge0.

...which could mean "this device doesn't have an address of that type" or "there is no such device".

But as shown in the ifconfig output, there was no IP interface named
bge0, so it couldn't possibly have obtained a default interface of bge0 from SIOCGLIFCONF. According to truss, in the version of libpcap that I have, it uses libdlpi's dlpi_walk(), which is a reasonable and supported
way of obtaining the list of datalinks on Solaris.

It uses SIOCGLIFCONF *and*, if you have libdlpi, dlpi_walk(). Does SIOCGLIFCONF also return IPv4 and IPv6 addresses for the interface? If so, then using both has the advantage that you also get the addresses, that being what pcap_findalldevs() returns (a list of interfaces, each of which has 0 or more addresses).
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: