]> The Tcpdump Group git mirrors - tcpdump/commitdiff
EAP: label length mismatch as a possible EAP fragment.
authorGuy Harris <[email protected]>
Sun, 14 Nov 2021 02:44:57 +0000 (18:44 -0800)
committerGuy Harris <[email protected]>
Sun, 14 Nov 2021 02:44:57 +0000 (18:44 -0800)
In some cases, EAP fragmentation/reassembly is done at a layer above
EAP, e.g. when EAP messages are contained within a RADIUS message and
are broken up into multiple TLVs in the message.  In those cases, the
length handed to eap_print() will be different from the length in the
first fragment's header, and the remaining fragments won't *have* a
header, so the "length" will be garbage and thus unlikely to be equal to
the length handed to us.

print-eap.c

index 8a2411cbf25db8e36f8d63398b331e4d6c55d0d6..42b22f625c733e1813e7b0a9e509ae80decc514f 100644 (file)
@@ -157,7 +157,14 @@ eap_print(netdissect_options *ndo,
     type = GET_U_1(cp);
     len = GET_BE_U_2(cp + 2);
     if(len != length) {
-       goto trunc;
+        /*
+         * Probably a fragment; in some cases the fragmentation might
+         * not put an EAP header on every packet, if reassembly can
+         * be done without that (e.g., fragmentation to make a message
+         * fit in multiple TLVs in a RADIUS packet).
+         */
+        ND_PRINT("EAP fragment?");
+        return;
     }
     ND_PRINT("%s (%u), id %u, len %u",
             tok2str(eap_code_values, "unknown", type),