Code value 0 is not assigned, and the code block guarded by the if() is
specific to Request (1) and Response (2) only. This change prevents the
printer from decoding some invalid EAP messages as if they were valid.
[skip ci]
ND_TCHECK_LEN(tptr, len);
ND_TCHECK_LEN(tptr, len);
- if (type <= 2) { /* For EAP_REQUEST and EAP_RESPONSE only */
+ if (type == EAP_REQUEST || type == EAP_RESPONSE) {
+ /* RFC 3748 Section 4.1 */
ND_TCHECK_1(tptr + 4);
subtype = EXTRACT_U_1(tptr + 4);
ND_PRINT("\n\t\t Type %s (%u)",
ND_TCHECK_1(tptr + 4);
subtype = EXTRACT_U_1(tptr + 4);
ND_PRINT("\n\t\t Type %s (%u)",