From: Guy Harris Date: Thu, 17 Sep 2015 19:59:12 +0000 (-0700) Subject: Don't fetch statistics in verbose_stats_dump(). X-Git-Tag: tcpdump-4.8.0~129 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/2a85a1bba4c2e63094a259c5d0ed397f234ba5f3?ds=inline Don't fetch statistics in verbose_stats_dump(). It only prints *our* (tcpdump's) count of packets seen, so it doesn't need to fetch statistics from libpcap/WinPcap. --- diff --git a/tcpdump.c b/tcpdump.c index 8a171c39..ca46638e 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -2195,17 +2195,13 @@ RETSIGTYPE requestinfo(int signo _U_) void CALLBACK verbose_stats_dump (UINT timer_id _U_, UINT msg _U_, DWORD_PTR arg _U_, DWORD_PTR dw1 _U_, DWORD_PTR dw2 _U_) { - struct pcap_stat stat; - - if (infodelay == 0 && pcap_stats(pd, &stat) >= 0) + if (infodelay == 0) fprintf(stderr, "Got %u\r", packets_captured); } #elif defined(HAVE_ALARM) static void verbose_stats_dump(int sig _U_) { - struct pcap_stat stat; - - if (infodelay == 0 && pcap_stats(pd, &stat) >= 0) + if (infodelay == 0) fprintf(stderr, "Got %u\r", packets_captured); alarm(1); }