diff options
author | Joseph Mingrone <jrm@FreeBSD.org> | 2024-09-06 02:11:27 +0000 |
---|---|---|
committer | Joseph Mingrone <jrm@FreeBSD.org> | 2024-09-06 02:36:15 +0000 |
commit | 75d9de99aec2d9f3bdc495c91bbd6d7a2392e2a3 (patch) | |
tree | 99d6c086833d530e5d1d33a8128961f8149843f0 /print-fr.c | |
parent | 51a183021fce3928d24b11c319d2787f5a15ae87 (diff) |
Diffstat (limited to 'print-fr.c')
-rw-r--r-- | print-fr.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/print-fr.c b/print-fr.c index f0d7fbeb12b3..79e32ceb07a7 100644 --- a/print-fr.c +++ b/print-fr.c @@ -21,9 +21,7 @@ /* \summary: Frame Relay printer */ -#ifdef HAVE_CONFIG_H #include <config.h> -#endif #include "netdissect-stdinc.h" @@ -526,11 +524,18 @@ mfr_print(netdissect_options *ndo, break; case MFR_CTRL_IE_TIMESTAMP: - if (ie_len == sizeof(struct timeval)) { - ts_print(ndo, (const struct timeval *)tptr); + /* + * FRF.16.1 Section 3.4.4 Timestamp Information Element + * + * The maximum length is 14 octets. Format is implementation + * specific. + */ + if (ie_len > 14) { + ND_PRINT("[Timestamp IE length %d > 14]", ie_len); + nd_print_invalid(ndo); break; } - /* fall through and hexdump if no unix timestamp */ + /* fall through and hexdump */ ND_FALL_THROUGH; /* @@ -1142,8 +1147,7 @@ fr_q933_print_ie_codeset_0_5(netdissect_options *ndo, u_int iecode, dlci = ((GET_U_1(p) & 0x3F) << 4) | ((GET_U_1(p + 1) & 0x78) >> 3); if (ielength == 4) { dlci = (dlci << 6) | ((GET_U_1(p + 2) & 0x7E) >> 1); - } - else if (ielength == 5) { + } else if (ielength == 5) { dlci = (dlci << 13) | (GET_U_1(p + 2) & 0x7F) | ((GET_U_1(p + 3) & 0x7E) >> 1); } |