diff options
author | Michael Mann <mmann78@netscape.net> | 2018-12-27 11:34:09 -0500 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-12-29 08:16:01 +0000 |
commit | 785621dcca96d3e735c4a6dc2da31c44238e1eb9 (patch) | |
tree | def08e8b30753bf281ce049582bfc4409e3095ed /dumpcap.c | |
parent | d68a8a36054a26e520647a9402e9e405efd8cf3e (diff) |
Add interface name when outputting packets dropped.
Add interface name (colon delimited) to SP_DROPS ('D') message so when dropped
packets are outputted, they include the interface name for clarity.
Bug: 13498
Change-Id: I68cdde4f20a574580f089dc5096d815cde5d3357
Reviewed-on: https://code.wireshark.org/review/31218
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'dumpcap.c')
-rw-r--r-- | dumpcap.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -5550,17 +5550,16 @@ report_capture_error(const char *error_msg, const char *secondary_error_msg) static void report_packet_drops(guint32 received, guint32 pcap_drops, guint32 drops, guint32 flushed, guint32 ps_ifdrop, gchar *name) { - char tmp[SP_DECISIZE+1+1]; guint32 total_drops = pcap_drops + drops + flushed; - g_snprintf(tmp, sizeof(tmp), "%u", total_drops); - if (capture_child) { + char* tmp = g_strdup_printf("%u:%s", total_drops, name); + g_log(LOG_DOMAIN_CAPTURE_CHILD, G_LOG_LEVEL_DEBUG, "Packets received/dropped on interface '%s': %u/%u (pcap:%u/dumpcap:%u/flushed:%u/ps_ifdrop:%u)", name, received, total_drops, pcap_drops, drops, flushed, ps_ifdrop); - /* XXX: Need to provide interface id, changes to consumers required. */ pipe_write_block(2, SP_DROPS, tmp); + g_free(tmp); } else { fprintf(stderr, "Packets received/dropped on interface '%s': %u/%u (pcap:%u/dumpcap:%u/flushed:%u/ps_ifdrop:%u) (%.1f%%)\n", |