summaryrefslogtreecommitdiff
path: root/print-eap.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-eap.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-eap.c')
-rw-r--r--print-eap.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/print-eap.c b/print-eap.c
index 0d9f62b7..e2de4c13 100644
--- a/print-eap.c
+++ b/print-eap.c
@@ -154,9 +154,7 @@ eap_print(netdissect_options *ndo,
u_int type, subtype, len;
int count;
- ND_TCHECK_1(cp);
type = GET_U_1(cp);
- ND_TCHECK_2(cp + 2);
len = GET_BE_U_2(cp + 2);
if(len != length) {
goto trunc;
@@ -171,7 +169,6 @@ eap_print(netdissect_options *ndo,
if (type == EAP_REQUEST || type == EAP_RESPONSE) {
/* RFC 3748 Section 4.1 */
- ND_TCHECK_1(cp + 4);
subtype = GET_U_1(cp + 4);
ND_PRINT("\n\t\t Type %s (%u)",
tok2str(eap_type_values, "unknown", subtype),
@@ -201,7 +198,6 @@ eap_print(netdissect_options *ndo,
* type one octet per type
*/
while (count < (int)len) {
- ND_TCHECK_1(cp + count);
ND_PRINT(" %s (%u),",
tok2str(eap_type_values, "unknown", GET_U_1((cp + count))),
GET_U_1(cp + count));
@@ -220,7 +216,6 @@ eap_print(netdissect_options *ndo,
GET_U_1(cp + 5));
if (EAP_TLS_EXTRACT_BIT_L(GET_U_1(cp + 5))) {
- ND_TCHECK_4(cp + 6);
ND_PRINT(" len %u", GET_BE_U_4(cp + 6));
}
break;
@@ -234,7 +229,6 @@ eap_print(netdissect_options *ndo,
GET_U_1(cp + 5));
if (EAP_TLS_EXTRACT_BIT_L(GET_U_1(cp + 5))) {
- ND_TCHECK_4(cp + 6);
ND_PRINT(" len %u", GET_BE_U_4(cp + 6));
}
@@ -243,7 +237,6 @@ eap_print(netdissect_options *ndo,
case EAP_TYPE_AKA:
case EAP_TYPE_SIM:
- ND_TCHECK_1(cp + 5);
ND_PRINT(" subtype [%s] 0x%02x,",
tok2str(eap_aka_subtype_values, "unknown", GET_U_1((cp + 5))),
GET_U_1(cp + 5));