Alexander Dupuy wrote:
The crux of the problem is that the line with
*stats = handle->md.stat;
was replaced with
stats->ps_recv = handle->md.packets_read;
stats->ps_drop = 0;
...rather than being executed, followed by a "return 0;", if we succeed
in getting the statistics from the kernel.
I've checked in a change to put
*stats = handle->md.stat;
return 0;
in the "success" branch of the "getsockopt()" if statement. That means
that if the getsockopt() call fails with EOPNOTSUPP (meaning the library
was built with PACKET_STATISTICS support but is being run on a system
without it), or if the code to make the getsockopt() call is missing
(meaning the library was built without PACKET_STATISTICS support), it'll
do the
stats->ps_recv = handle->md.packets_read;
stats->ps_drop = 0;
stuff.
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.