From 70fc59d810d3d8819429580d300206af8c079ea6 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Thu, 24 Sep 2020 16:07:12 +0200 Subject: [PATCH] LLDP: Replace some magic numbers --- print-lldp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/print-lldp.c b/print-lldp.c index a9996879..812d72e5 100644 --- a/print-lldp.c +++ b/print-lldp.c @@ -1350,17 +1350,17 @@ lldp_network_addr_print(netdissect_options *ndo, const u_char *tptr, u_int len) af = GET_U_1(tptr); switch (af) { case AFNUM_INET: - if (len < 4) + if (len < sizeof(nd_ipv4)) return NULL; pfunc = ipaddr_string; break; case AFNUM_INET6: - if (len < 16) + if (len < sizeof(nd_ipv6)) return NULL; pfunc = ip6addr_string; break; case AFNUM_802: - if (len < 6) + if (len < MAC_ADDR_LEN) return NULL; pfunc = etheraddr_string; break;