tcpdump mailing list archives

Re: libpcap: patches required for OpenSolaris/SXCE


From: Guy Harris <guy () alum mit edu>
Date: Tue, 1 Dec 2009 18:37:52 -0800


On Dec 1, 2009, at 6:18 PM, Darren Reed wrote:

Yes, Solaris does have this *but* it returns interfaces used with IPv4.
In libpcap, the code does:

fd4 = socket(AF_INET, SOCK_GRAM, 0);
...
if (ioctl(fd4, SIOCGLIFCONF, (char *)&ifc) < 0) {

On Solaris, each network address family has its own association with
a network interface. Thus doing SIOCGLIFCONF for an AF_INET
socket can produce different results to SIOCGLIFCONF for an
AF_INET6 socket.

So if fad-glifc.c did SIOCGLIFCONF on both an AF_INET socket and an AF_INET6 socket, returning the union of the interfaces returned by them, combining the address lists for interfaces that show up in both, would that return a list of all interfaces with IPv4 and/or IPv6 interfaces?

I think I would still advocate that pcap_lookupnet() should be fatal if "-f" is present, though :)

And, ideally, if "ip broadcast" is used, either. Unfortunately, there's no way in pcap_compile() to specify "netmask unknown".
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: