]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lldp.c
CVE-2017-13040/MPTCP: Clean up printing DSS suboption.
[tcpdump] / print-lldp.c
index fbafd6d5a14af87811fa0006a34a5597749c2edd..add7e6a5f94133645ac7b880dbe80e69f8ff7b25 100644 (file)
@@ -651,7 +651,7 @@ lldp_private_8021_print(netdissect_options *ndo,
     int subtype, hexdump = FALSE;
     u_int sublen;
     u_int tval;
-    uint8_t i;
+    u_int i;
 
     if (tlv_len < 4) {
         return hexdump;
@@ -787,9 +787,9 @@ lldp_private_8021_print(netdissect_options *ndo,
         ND_PRINT((ndo, "\n\t    Application Priority Table"));
         while(i<sublen) {
                tval=*(tptr+i+5);
-               ND_PRINT((ndo, "\n\t      Priority: %d, RES: %d, Sel: %d",
-                        tval >> 5, (tval >> 3) & 0x03, (tval & 0x07)));
-               ND_PRINT((ndo, "Protocol ID: %d", EXTRACT_16BITS(tptr + i + 5)));
+               ND_PRINT((ndo, "\n\t      Priority: %u, RES: %u, Sel: %u, Protocol ID: %u",
+                        tval >> 5, (tval >> 3) & 0x03, (tval & 0x07),
+                        EXTRACT_16BITS(tptr + i + 5)));
                i=i+3;
         }
         break;
@@ -927,7 +927,7 @@ lldp_extract_latlon(const u_char *tptr)
  * (right now there is only one)
  */
 
+
 static int
 lldp_private_iana_print(netdissect_options *ndo,
                         const u_char *tptr, u_int tlv_len)
@@ -951,12 +951,12 @@ lldp_private_iana_print(netdissect_options *ndo,
     default:
         hexdump=TRUE;
     }
-    
+
     return hexdump;
 }
 
 
-      
+
 /*
  * Print private TIA extensions.
  */
@@ -1401,7 +1401,7 @@ lldp_mgmt_addr_tlv_print(netdissect_options *ndo,
     if (tlen) {
         oid_len = *tptr;
 
-        if (tlen < oid_len) {
+        if (tlen < 1U + oid_len) {
             return 0;
         }
         if (oid_len) {