tcpdump mailing list archives

Re: pcap_activate can cause pcap_geterr to return a blank string


From: Guy Harris <guy () alum mit edu>
Date: Tue, 11 Aug 2009 21:34:41 -0700


On Aug 7, 2009, at 5:02 PM, Dustin Spicuzza wrote:

However, thats another decision that has to be made by the user, so it
seems like it would be nice and simple if pcap_geterr just worked no
matter what kind of error was returned. Add two lines to pcap_activate
to make pcap_geterr work as expected:

Checked in and pushed, but:

        else if (!p->errbuf[0])
                snprintf( p->errbuf, PCAP_ERRBUF_SIZE, "%s: %s", p->opt.source,
pcap_statustostr(status) );

...the error you get from pcap_activate() doesn't include the device name - the program displaying the error is expected to do whatever it deems appropriate with the error string, which might or might not be to put it right next to the error string - so I just set the error string to the result of pcap_statustostr().

(pcap_open_live() is different.)
-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: