summaryrefslogtreecommitdiff
path: root/proto_ethernet.c
diff options
context:
space:
mode:
Diffstat (limited to 'proto_ethernet.c')
-rw-r--r--proto_ethernet.c11
1 files changed, 4 insertions, 7 deletions
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, &eth_lay2, ntohs(eth->h_proto));