summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2016-08-02 10:16:54 +0200
committerTobias Klauser <tklauser@distanz.ch>2016-08-02 10:19:32 +0200
commita378db32a6e88a04d839bf2c2f27f62d81986186 (patch)
tree4c899713a082fe8cf7edd77a2957049bc0445e0b
parentda6e1d1108ad22d68ccbff07fb569afebb265bf7 (diff)
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 <tklauser@distanz.ch>
-rw-r--r--proto_ethernet.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/proto_ethernet.c b/proto_ethernet.c
index 9bb0042..bd84acc 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 */