the size of the buffer we handed to it is insufficient to determine
whether we have the entire list of interfaces or not - if the amount of
space left in the buffer after adding an entry is non-zero but less
than the amount of space required by the next entry, the ioctl will stop
before adding the next entry, and not necessarily return an error.
The only way to ensure that we got all the data is to pass a buffer
large enough that the amount of space in the buffer *not* filled in
is greater than the largest possible entry.
We assume that's "sizeof(ifreq.ifr_name)" plus 255, under the assumption
that no address is more than 255 bytes (on systems where the "sa_len"
field in a "struct sockaddr" is 1 byte, e.g. newer BSDs, that's the
case, and addresses are unlikely to be bigger than that in any case).
additional IP addresses for the underlying interface; instead, strip off
the logical interface number, and add them so that the additional
addresses are added.
followed by a number; Ethereal has those checks in the code it uses when
not using "pcap_findalldevs()" - I'm not sure what the "dummy" is
checking for (Linux dummy interfaces?), but the ":" followed by a number
are Solaris virtual interfaces (I think that's how it implements
multiple IP addresses per "real" interface, with each additional address
getting a virtual interface; I'm not sure you can open a virtual
interface for capturing, and even if you can you won't, as far as I
know, see any packets other than the one you get for the "real"
interface - should we just ignore the ":{number}" and "add" that
interface so that we add its IP address?).
source files, rather than having a pile of #ifdefs in "inet.c". Add
code to the configure script to determine which implementation to use on
the platform for which libpcap is being built.
Add a "pcap_findalldevs()" implementation for Solaris 8 and later that
handles IPv6 addresses.