tcpdump mailing list archives

Re: Tcpdump doesn't check for pcap_set_tstamp_type warnings


From: Guy Harris <gharris () sonic net>
Date: Sun, 29 Jul 2018 14:50:04 -0700

On Jul 29, 2018, at 8:57 AM, Greg Steinbrecher <grs () fb com> wrote:

When tcpdump calls pcap_set_tstamp_type, it only checks if the returned status is less than 0; if the specific type 
requested exists but isn't supported (e.g. `-j adapter` on a card that only supports adapter_unsynced) 
pcap_set_tstamp_type returns the warning code PCAP_WARNING_TSTAMP_TYPE_NOTSUP which is #defined to be 2 as it's a 
warning, not an error.

...and its name contains the word "WARNING".

End result is that, e.g., `-j adapter` on a card that only supports adapter_unsynced fails silently, falling back to 
host clock, with no warning.

I'm happy to submit a pull request fixing this, but wanted to check if the preference is to (a) warn the user and 
move on or (b) treat this as a failure and quit.

(a) You get time stamps, just not ones as precise as you might like, so warn the user and move on.

(And don't get me started on hardware time stamps giving seconds since the TAI epoch rather than since the UTC 
epoch....)
_______________________________________________
tcpdump-workers mailing list
tcpdump-workers () lists tcpdump org
https://lists.sandelman.ca/mailman/listinfo/tcpdump-workers

Current thread: