summaryrefslogtreecommitdiff
path: root/print-slow.c
diff options
context:
space:
mode:
authorFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-08-10 16:22:37 +0200
committerFrancois-Xavier Le Bail <devel.fx.lebail@orange.fr>2020-09-05 14:59:21 +0200
commit929e4be621ebdcede37865a5767a175f083f9138 (patch)
treebf6ecbc038696e66176b2d50e04e015767f23b3d /print-slow.c
parent54b5db3dde658894be730b15480f9b6e27b717a0 (diff)
downloadtcpdump-test-rc.tar.gz
Remove many (761) redundant ND_TCHECK_n() callstest-rc
ND_TCHECK_n(e), n in { 1, 2, 3, 4, 8 }. They are redundant because they are followed by a GET_.*_n(e) call, same n, same e, which do the bounds check. Remove unused 'trunc' labels and most associated codes. Update the outputs of some tests accordingly.
Diffstat (limited to 'print-slow.c')
-rw-r--r--print-slow.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/print-slow.c b/print-slow.c
index 27a814b9..3529f03b 100644
--- a/print-slow.c
+++ b/print-slow.c
@@ -251,7 +251,6 @@ slow_print(netdissect_options *ndo,
ndo->ndo_protocol = "slow";
if (len < 1)
goto tooshort;
- ND_TCHECK_1(pptr);
subtype = GET_U_1(pptr);
/*
@@ -261,7 +260,6 @@ slow_print(netdissect_options *ndo,
case SLOW_PROTO_LACP:
if (len < 2)
goto tooshort;
- ND_TCHECK_1(pptr + 1);
if (GET_U_1(pptr + 1) != LACP_VERSION) {
ND_PRINT("LACP version %u packet not supported",
GET_U_1(pptr + 1));
@@ -273,7 +271,6 @@ slow_print(netdissect_options *ndo,
case SLOW_PROTO_MARKER:
if (len < 2)
goto tooshort;
- ND_TCHECK_1(pptr + 1);
if (GET_U_1(pptr + 1) != MARKER_VERSION) {
ND_PRINT("MARKER version %u packet not supported",
GET_U_1(pptr + 1));
@@ -339,10 +336,6 @@ tooshort:
ND_PRINT(" (packet is too short)");
else
ND_PRINT("\n\t\t packet is too short");
- return;
-
-trunc:
- nd_print_trunc(ndo);
}
static void
@@ -628,7 +621,6 @@ slow_oam_print(netdissect_options *ndo,
/* Sequence number */
if (tlen < 2)
goto tooshort;
- ND_TCHECK_2(tptr);
ND_PRINT("\n\t Sequence Number %u", GET_BE_U_2(tptr));
tlen -= 2;
tptr += 2;