Skip to content

Commit

Permalink
dissectors: ethernet: Don't resolve OUI for locally administered addr…
Browse files Browse the repository at this point in the history
…esses

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>
  • Loading branch information
tklauser committed Aug 2, 2016
1 parent da6e1d1 commit a378db3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions proto_ethernet.c
Expand Up @@ -25,13 +25,20 @@ 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)) {
if (is_broadcast_ether_addr(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 */
Expand Down

0 comments on commit a378db3

Please sign in to comment.