aboutsummaryrefslogtreecommitdiffstats
path: root/tshark.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2018-12-27 11:34:09 -0500
committerAnders Broman <a.broman58@gmail.com>2018-12-29 08:16:01 +0000
commit785621dcca96d3e735c4a6dc2da31c44238e1eb9 (patch)
treedef08e8b30753bf281ce049582bfc4409e3095ed /tshark.c
parentd68a8a36054a26e520647a9402e9e405efd8cf3e (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 'tshark.c')
-rw-r--r--tshark.c8
1 files changed, 6 insertions, 2 deletions
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"));
+ }
}
}