tcpdump mailing list archives

Re: SEGFAULT in pcap_findalldevs on OpenBSD 3.4


From: Guy Harris <guy () alum mit edu>
Date: Thu, 11 Mar 2004 15:57:38 -0800


On Mar 11, 2004, at 1:37 PM, Mark Pizzolato wrote:

pcap_findalldevs dies on OpenBSD 3.4 while interpreting some of the data
returned by getifaddrs.  Specifically, the flag value suggests that a
Broadcast address is provided, but none is really returned.

This problem does not exist on FreeBSD or NetBSD.

Does OpenBSD 3.4 have an "SA_LEN()" macro that doesn't check whether its argument is null?

If so, do the versions of FreeBSD and NetBSD at which you're looking lack that macro?

If so, the problem is that "pcap_findalldevs()" is relying on "SA_LEN()" to do the checking for a null pointer - which works fine if "SA_LEN()" is the one defined in "fad-getad.c", but not so fine if it's supplied by the OS and doesn't do that checking.

I've checked in a change to remove the checks from "SA_LEN()" and have the code that *uses* "SA_LEN()" check for the null pointers. Try the current CVS version (either the main branch or the 0.8 branch - I've checked the changes into both places) and see if the problem is fixed.

-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:tcpdump-workers-request () tcpdump org?body=unsubscribe


Current thread: