]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-msdp.c
Use nd_ types, add EXTRACT_ calls.
[tcpdump] / print-msdp.c
index 91416876454ab025c86dab8a440ea716ea81d2bf..f1769de04a9807f9a7fcf39e1f6f178612efcd24 100644 (file)
@@ -37,14 +37,14 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length)
 
        ND_TCHECK_3(sp);
        /* See if we think we're at the beginning of a compound packet */
-       type = *sp;
+       type = EXTRACT_U_1(sp);
        len = EXTRACT_BE_U_2(sp + 1);
        if (len > 1500 || len < 3 || type == 0 || type > MSDP_TYPE_MAX)
                goto trunc;     /* not really truncated, but still not decodable */
        ND_PRINT((ndo, " msdp:"));
        while (length > 0) {
                ND_TCHECK_3(sp);
-               type = *sp;
+               type = EXTRACT_U_1(sp);
                len = EXTRACT_BE_U_2(sp + 1);
                if (len > 1400 || ndo->ndo_vflag)
                        ND_PRINT((ndo, " [len %u]", len));
@@ -59,14 +59,15 @@ msdp_print(netdissect_options *ndo, const u_char *sp, u_int length)
                                ND_PRINT((ndo, " SA"));
                        else
                                ND_PRINT((ndo, " SA-Response"));
-                       ND_TCHECK(*sp);
-                       ND_PRINT((ndo, " %u entries", *sp));
-                       if ((u_int)((*sp * 12) + 8) < len) {
+                       ND_TCHECK_1(sp);
+                       ND_PRINT((ndo, " %u entries", EXTRACT_U_1(sp)));
+                       if ((u_int)((EXTRACT_U_1(sp) * 12) + 8) < len) {
                                ND_PRINT((ndo, " [w/data]"));
                                if (ndo->ndo_vflag > 1) {
                                        ND_PRINT((ndo, " "));
-                                       ip_print(ndo, sp + *sp * 12 + 8 - 3,
-                                                len - (*sp * 12 + 8));
+                                       ip_print(ndo, sp +
+                                                EXTRACT_U_1(sp) * 12 + 8 - 3,
+                                                len - (EXTRACT_U_1(sp) * 12 + 8));
                                }
                        }
                        break;