From d245603ab331de51d774f3d69ba3689155b0eb53 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 5 May 2015 11:40:53 +0200 Subject: dissectors: ethernet: Display multicast/broadcast also in less mode Commit a37101161784 ("dissectors: ethernet: Handle multicast/broadcast addresses properly") introduced handling of multicast/broadcast addresses in string translation, but only for the verbose mode. Also print these strings instead of "Unknown" in less mode. Signed-off-by: Tobias Klauser --- proto_ethernet.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'proto_ethernet.c') diff --git a/proto_ethernet.c b/proto_ethernet.c index 5a257f0..a8e10cf 100644 --- a/proto_ethernet.c +++ b/proto_ethernet.c @@ -26,7 +26,7 @@ static inline bool is_broadcast_ether_addr(const uint8_t *mac) return (mac[0] & mac[1] & mac[2] & mac[3] & mac[4] & mac[5]) == 0xff; } -static const char *ether_lookup_addr(uint8_t *mac) +static const char *ether_lookup_addr(const uint8_t *mac) { if (is_multicast_ether_addr(mac)) { if (is_broadcast_ether_addr(mac)) @@ -82,12 +82,9 @@ static void ethernet_less(struct pkt_buff *pkt) src_mac = eth->h_source; dst_mac = eth->h_dest; - tprintf(" %s => %s ", - lookup_vendor_str((src_mac[0] << 16) | (src_mac[1] << 8) | - src_mac[2]), - lookup_vendor_str((dst_mac[0] << 16) | (dst_mac[1] << 8) | - dst_mac[2])); - tprintf("%s%s%s", colorize_start(bold), + tprintf(" %s => %s ", ether_lookup_addr(src_mac), + ether_lookup_addr(dst_mac)); + tprintf("%s%s%s", colorize_start(bold), lookup_ether_type(ntohs(eth->h_proto)), colorize_end()); pkt_set_dissector(pkt, ð_lay2, ntohs(eth->h_proto)); -- cgit v1.2.3-54-g00ecf