Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Multilink Frame Relay: Fix the Timestamp Information Element printing
Browse files Browse the repository at this point in the history
The specification say nothing about using an Unix timestamp.
Do only an hexa dump.
Add a length test.

FRF.16.1 Section 3.4.4 Timestamp Information Element states:

The maximum length is 14 octets. Format is implementation specific.

Granularity and interpretation of the Timestamp Information Element is
implementation specific.

(https://www.broadband-forum.org/download/FRF.16.1.pdf)

(cherry picked from commit aa9b00b)
  • Loading branch information
fxlb committed Mar 6, 2024
1 parent 68ea977 commit 6f162d6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions print-fr.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,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;

/*
Expand Down

0 comments on commit 6f162d6

Please sign in to comment.