summaryrefslogtreecommitdiff
path: root/dumpcap.c
diff options
context:
space:
mode:
authorMichael Tüxen <tuexen@fh-muenster.de>2012-04-25 17:43:44 +0000
committerMichael Tüxen <tuexen@fh-muenster.de>2012-04-25 17:43:44 +0000
commitd2526de5f8e0bdf42d263d522a44a37f0deb9ca6 (patch)
tree2e2908a38963bde700237cb93cc1e7d8e77bf5ac /dumpcap.c
parent0fe7859ca43d71b85dc132d93fe288631b559d2d (diff)
downloadwireshark-d2526de5f8e0bdf42d263d522a44a37f0deb9ca6.tar.gz
Fix the packet counters.
This fixes the inconsistencies reported on the command line by dumpcap as indicated by https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7191 svn path=/trunk/; revision=42236
Diffstat (limited to 'dumpcap.c')
-rw-r--r--dumpcap.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dumpcap.c b/dumpcap.c
index 76678d98ad..89a1754de0 100644
--- a/dumpcap.c
+++ b/dumpcap.c
@@ -3780,7 +3780,6 @@ capture_loop_write_packet_cb(u_char *pcap_opts_p, const struct pcap_pkthdr *phdr
"Wrote a packet of length %d captured on interface %u.",
phdr->caplen, pcap_opts->interface_id);
global_ld.packet_count++;
- pcap_opts->received++;
/* if the user told us to stop after x packets, do we already have enough? */
if ((global_ld.packet_max > 0) && (global_ld.packet_count >= global_ld.packet_max)) {
global_ld.go = FALSE;
@@ -3801,8 +3800,10 @@ capture_loop_queue_packet_cb(u_char *pcap_opts_p, const struct pcap_pkthdr *phdr
/* We may be called multiple times from pcap_dispatch(); if we've set
the "stop capturing" flag, ignore this packet, as we're not
supposed to be saving any more packets. */
- if (!global_ld.go)
+ if (!global_ld.go) {
+ pcap_opts->dropped++;
return;
+ }
queue_element = (pcap_queue_element *)g_malloc(sizeof(pcap_queue_element));
if (queue_element == NULL) {