[XS] Change in osmo-e1d[master]: HDLC timeslots: fix Rx of maximum-sized frames
tnt has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/42681?usp=email ) Change subject: HDLC timeslots: fix Rx of maximum-sized frames ...................................................................... HDLC timeslots: fix Rx of maximum-sized frames E1D protocol sets the maximum permitted size of an HDLC frame to 264 bytes of useful payload, not counting the 2 bytes of FCS. This limit is fair enough, as it matches GSM TS 08.56, the primary intended application. However, osmo_isdnhdlc engine used internally by the daemon requires an Rx buffer 2 bytes larger than the maximum payload length, for temporary storage of FCS bytes: by the nature of HDLC, a receiver has no way of identifying FCS bytes as such until after they have been received and stored in the Rx buffer. This bug was caught when bringing up OsmoBSC with Nokia Flexi Multiradio BTS. This BTS emits some long OML messages that get broken into segments, with each not-last segment traveling over HDLC as a maximum-sized frame - and these frames then get dropped by osmo-e1d, causing further breakage downstream. Change-Id: I479e8fe5118c8eb7d4e6b16b49047a3278bc9808 --- M src/e1d.h 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified tnt: Looks good to me, approved fixeria: Looks good to me, but someone else must approve diff --git a/src/e1d.h b/src/e1d.h index 5015761..7d2d4c6 100644 --- a/src/e1d.h +++ b/src/e1d.h @@ -101,7 +101,8 @@ struct osmo_isdnhdlc_vars tx; struct osmo_isdnhdlc_vars rx; - uint8_t rx_buf[E1DP_MAX_SIZE_HDLC]; + /* extra 2 bytes needed for FCS */ + uint8_t rx_buf[E1DP_MAX_SIZE_HDLC + 2]; uint8_t tx_buf[E1DP_MAX_SIZE_HDLC]; int tx_ofs; int tx_len; -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/42681?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I479e8fe5118c8eb7d4e6b16b49047a3278bc9808 Gerrit-Change-Number: 42681 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <falcon@freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de> Gerrit-Reviewer: laforge <laforge@osmocom.org> Gerrit-Reviewer: tnt <tnt@246tNt.com> Gerrit-CC: pespin <pespin@sysmocom.de>
participants (1)
-
tnt