]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lldp.c
CHANGES: Add a change backported to 4.99
[tcpdump] / print-lldp.c
index 7895c1adb4a10e9c5440c4e7f94c64e396ad174e..c12e37d037275431478c438845beec293bcb4425 100644 (file)
@@ -19,9 +19,7 @@
 
 /* \summary: IEEE 802.1ab Link Layer Discovery Protocol (LLDP) printer */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -1088,7 +1086,7 @@ lldp_private_tia_print(netdissect_options *ndo,
             tptr = tptr + 9;
 
             /* Decode each civic address element */
-            while (lci_len > 0) {
+            while (lci_len != 0) {
                 if (lci_len < 2) {
                     return hexdump;
                 }
@@ -1098,7 +1096,7 @@ lldp_private_tia_print(netdissect_options *ndo,
                tptr += 2;
                 lci_len -= 2;
 
-                ND_PRINT("\n\t      CA type \'%s\' (%u), length %u: ",
+                ND_PRINT("\n\t      CA type '%s' (%u), length %u: ",
                        tok2str(lldp_tia_location_lci_catype_values, "unknown", ca_type),
                        ca_type, ca_len);
 
@@ -1349,20 +1347,20 @@ lldp_network_addr_print(netdissect_options *ndo, const u_char *tptr, u_int len)
     len--;
     af = GET_U_1(tptr);
     switch (af) {
-    case AFNUM_INET:
+    case AFNUM_IP:
         if (len < sizeof(nd_ipv4))
           return NULL;
         pfunc = ipaddr_string;
         break;
-    case AFNUM_INET6:
+    case AFNUM_IP6:
         if (len < sizeof(nd_ipv6))
           return NULL;
         pfunc = ip6addr_string;
         break;
     case AFNUM_802:
-        if (len < MAC_ADDR_LEN)
+        if (len < MAC48_LEN)
           return NULL;
-        pfunc = etheraddr_string;
+        pfunc = mac48_string;
         break;
     default:
         pfunc = NULL;
@@ -1505,7 +1503,7 @@ lldp_print(netdissect_options *ndo,
                     if (tlv_len < 1+6) {
                         goto trunc;
                     }
-                    ND_PRINT("%s", GET_ETHERADDR_STRING(tptr + 1));
+                    ND_PRINT("%s", GET_MAC48_STRING(tptr + 1));
                     break;
 
                 case LLDP_CHASSIS_INTF_NAME_SUBTYPE: /* fall through */
@@ -1546,7 +1544,7 @@ lldp_print(netdissect_options *ndo,
                     if (tlv_len < 1+6) {
                         goto trunc;
                     }
-                    ND_PRINT("%s", GET_ETHERADDR_STRING(tptr + 1));
+                    ND_PRINT("%s", GET_MAC48_STRING(tptr + 1));
                     break;
 
                 case LLDP_PORT_INTF_NAME_SUBTYPE: /* fall through */