From 785621dcca96d3e735c4a6dc2da31c44238e1eb9 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Thu, 27 Dec 2018 11:34:09 -0500 Subject: 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 Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- tshark.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'tshark.c') diff --git a/tshark.c b/tshark.c index 51bf2e649a..cbd9768a0a 100644 --- a/tshark.c +++ b/tshark.c @@ -2777,7 +2777,7 @@ report_counts_siginfo(int signum _U_) /* capture child detected any packet drops? */ void -capture_input_drops(capture_session *cap_session _U_, guint32 dropped) +capture_input_drops(capture_session *cap_session _U_, guint32 dropped, char* interface_name) { if (print_packet_counts) { /* We're printing packet counts to stderr. @@ -2788,7 +2788,11 @@ capture_input_drops(capture_session *cap_session _U_, guint32 dropped) if (dropped != 0) { /* We're printing packet counts to stderr. Send a newline so that we move to the line after the packet count. */ - fprintf(stderr, "%u packet%s dropped\n", dropped, plurality(dropped, "", "s")); + if (interface_name != NULL) { + fprintf(stderr, "%u packet%s dropped from %s\n", dropped, plurality(dropped, "", "s"), interface_name); + } else { + fprintf(stderr, "%u packet%s dropped\n", dropped, plurality(dropped, "", "s")); + } } } -- cgit v1.2.3