From d7a908c25ceb2d49367f059e3f3aad93221d7593 Mon Sep 17 00:00:00 2001 From: Martin Fesser Date: Wed, 21 Aug 2019 15:08:51 +0200 Subject: show interface name in frame line caption if set Change-Id: Ib6cb86bc20dae9f88fdeb469983c2380bcc9216d Reviewed-on: https://code.wireshark.org/review/34335 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- epan/dissectors/packet-frame.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/epan/dissectors/packet-frame.c b/epan/dissectors/packet-frame.c index f721ea5aed..81b67f8006 100644 --- a/epan/dissectors/packet-frame.c +++ b/epan/dissectors/packet-frame.c @@ -353,8 +353,15 @@ dissect_frame(tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* cap_len * 8); } if (pinfo->rec->presence_flags & WTAP_HAS_INTERFACE_ID) { - proto_item_append_text(ti, " on interface %u", + const char *interface_name = epan_get_interface_name(pinfo->epan, pinfo->rec->rec_header.packet_header.interface_id); + if (interface_name != NULL) { + proto_item_append_text(ti, " on interface %s, id %u", + interface_name, pinfo->rec->rec_header.packet_header.interface_id); + } else { + proto_item_append_text(ti, " on unnamed interface, id %u", + pinfo->rec->rec_header.packet_header.interface_id); + } } if (pinfo->rec->presence_flags & WTAP_HAS_PACK_FLAGS) { switch (PACK_FLAGS_DIRECTION(pinfo->rec->rec_header.packet_header.pack_flags)) { -- cgit v1.2.3