]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-udld.c
Use more the ND_TTEST_1() macro
[tcpdump] / print-udld.c
index 6833ed68c804ee4e3c78bcafa60e7c89832adcaa..0bc71ea82353e593c2890b649bea53ddb581cd04 100644 (file)
@@ -104,12 +104,12 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length)
 
     tptr = pptr;
 
-    ND_TCHECK2(*tptr, UDLD_HEADER_LEN);
+    ND_TCHECK_LEN(tptr, UDLD_HEADER_LEN);
 
-    code = UDLD_EXTRACT_OPCODE(*tptr);
+    code = UDLD_EXTRACT_OPCODE(EXTRACT_U_1(tptr));
 
     ND_PRINT((ndo, "UDLDv%u, Code %s (%x), Flags [%s] (0x%02x), length %u",
-           UDLD_EXTRACT_VERSION(*tptr),
+           UDLD_EXTRACT_VERSION(EXTRACT_U_1(tptr)),
            tok2str(udld_code_values, "Reserved", code),
            code,
            bittok2str(udld_flags_values, "none", EXTRACT_U_1((tptr + 1))),
@@ -147,7 +147,7 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length)
         len -= 4;
         tptr += 4;
 
-        ND_TCHECK2(*tptr, len);
+        ND_TCHECK_LEN(tptr, len);
 
         switch (type) {
         case UDLD_DEVICE_ID_TLV:
@@ -166,7 +166,7 @@ udld_print (netdissect_options *ndo, const u_char *pptr, u_int length)
         case UDLD_TIMEOUT_INTERVAL_TLV:
             if (len != 1)
                 goto invalid;
-            ND_PRINT((ndo, ", %us", (*tptr)));
+            ND_PRINT((ndo, ", %us", (EXTRACT_U_1(tptr))));
             break;
 
         case UDLD_SEQ_NUMBER_TLV: