From a378db32a6e88a04d839bf2c2f27f62d81986186 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 2 Aug 2016 10:16:54 +0200 Subject: [PATCH] dissectors: ethernet: Don't resolve OUI for locally administered addresses Locally administered addresses do not contain an OUI, thus do not try to resolve it. Instead show "Locally Administered" as the vendor string. Signed-off-by: Tobias Klauser --- proto_ethernet.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/proto_ethernet.c b/proto_ethernet.c index 9bb00423f..bd84accf0 100644 --- a/proto_ethernet.c +++ b/proto_ethernet.c @@ -25,6 +25,11 @@ 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 inline bool is_local_ether_addr(const u8 *mac) +{ + return 0x02 & mac[0]; +} + static const char *ether_lookup_addr(const uint8_t *mac) { if (is_multicast_ether_addr(mac)) { @@ -32,6 +37,8 @@ static const char *ether_lookup_addr(const uint8_t *mac) return "Broadcast"; else return "Multicast"; + } else if (is_local_ether_addr(mac)) { + return "Locally Administered"; } /* found no matching address, so look up the vendor from OUI */