]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Don't fetch statistics in verbose_stats_dump().
authorGuy Harris <[email protected]>
Thu, 17 Sep 2015 19:59:12 +0000 (12:59 -0700)
committerGuy Harris <[email protected]>
Thu, 17 Sep 2015 19:59:12 +0000 (12:59 -0700)
It only prints *our* (tcpdump's) count of packets seen, so it doesn't
need to fetch statistics from libpcap/WinPcap.

tcpdump.c

index 8a171c3997b81724a615b8a52e261239f7dd6037..ca46638e1662e64fa00f09eaf1126716e30dfd68 100644 (file)
--- 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);
 }