]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-juniper.c
juniper: don't do bounds checking for fields in the cookie.
[tcpdump] / print-juniper.c
index c02de78e6e1bed6d1b48c1baf71366941b08fa14..48b8a35521404d1b0fc09c4f9a9c42afe0419223 100644 (file)
@@ -495,13 +495,13 @@ juniper_ggsn_if_print(netdissect_options *ndo,
         p+=l2info.header_len;
         gh = (struct juniper_ggsn_header *)&l2info.cookie;
 
-        ND_TCHECK_SIZE(gh);
-        proto = GET_U_1(gh->proto);
+        /* use EXTRACT_, not GET_ (not packet buffer pointer) */
+        proto = EXTRACT_U_1(gh->proto);
         if (ndo->ndo_eflag) {
             ND_PRINT("proto %s (%u), vlan %u: ",
                    tok2str(juniper_protocol_values,"Unknown",proto),
                    proto,
-                   GET_BE_U_2(gh->vlan_id));
+                   EXTRACT_BE_U_2(gh->vlan_id));
         }
 
         switch (proto) {