]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-zep.c
Refine INSTALL.txt. [skip ci]
[tcpdump] / print-zep.c
index 1e34c21508f7bc2abe3b8d5b0c4f87e9a17aa00a..e10ecb35771ac849f12674f9053f608f56270d2c 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "netdissect-stdinc.h"
 
+#define ND_LONGJMP_FROM_TCHECK
 #include "netdissect.h"
 
 #include "extract.h"
@@ -107,8 +108,6 @@ zep_print(netdissect_options *ndo,
 
        nd_print_protocol_caps(ndo);
 
-       ND_TCHECK_LEN(bp, 8);
-
        /* Preamble Code (must be "EX") */
        if (GET_U_1(bp) != 'E' || GET_U_1(bp + 1) != 'X') {
                ND_PRINT(" [Preamble Code: ");
@@ -124,7 +123,6 @@ zep_print(netdissect_options *ndo,
 
        if (version == 1) {
                /* ZEP v1 packet. */
-               ND_TCHECK_LEN(bp, 16);
                ND_PRINT("Channel ID %u, Device ID 0x%04x, ",
                         GET_U_1(bp + 3), GET_BE_U_2(bp + 4));
                if (GET_U_1(bp + 6))
@@ -147,8 +145,6 @@ zep_print(netdissect_options *ndo,
                        len -= 8;
                } else {
                        /* ZEP v2 data, or some other. */
-                       ND_TCHECK_LEN(bp, 32);
-
                        ND_PRINT("Type %u, Channel ID %u, Device ID 0x%04x, ",
                                 GET_U_1(bp + 3), GET_U_1(bp + 4),
                                 GET_BE_U_2(bp + 5));
@@ -171,6 +167,7 @@ zep_print(netdissect_options *ndo,
                /* Call 802.15.4 dissector. */
                ND_PRINT("\n\t");
                if (ieee802_15_4_print(ndo, bp, inner_len)) {
+                       ND_TCHECK_LEN(bp, len);
                        bp += len;
                        len = 0;
                }
@@ -178,8 +175,4 @@ zep_print(netdissect_options *ndo,
 
        if (!ndo->ndo_suppress_default_print)
                ND_DEFAULTPRINT(bp, len);
-
-       return;
- trunc:
-       nd_print_trunc(ndo);
 }