laforge has submitted this change. (
https://gerrit.osmocom.org/c/libosmo-abis/+/39625?usp=email )
Change subject: rtp2trau FR & EFR: disallow BFI in DL
......................................................................
rtp2trau FR & EFR: disallow BFI in DL
osmo_rtp2trau() accepts TW-TS-001 extended RTP payload format for
FR and EFR, converting to either TRAU-DL or TRAU-UL. This extended
format is required for TRAU-UL/TFO frame output, but it is also
accepted for conversion to TRAU-DL in order to support the current
form of OsmoMGW-E1 that has no TFO transform between RTP input and
TDM-timed calls to osmo_rtp2trau().
TW-TS-001 can represent not only good frames, but also bad ones -
however, bad frames on Abis are valid only in UL, not in DL. Prior
to the present patch, if a BFI-marked frame were fed to osmo_rtp2trau()
for conversion to TRAU-DL, the Bad Frame Indicator was dropped and
the garbage payload bits were emitted as if they were a good frame -
bad choice. Reject BFI frames in TRAU-DL mode, return -EINVAL.
Change-Id: Ic63943d4bde9902b27e4d8fe9a5fb6ccecbf36c6
---
M src/trau/trau_rtp_conv.c
1 file changed, 9 insertions(+), 0 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
pespin: Looks good to me, approved
diff --git a/src/trau/trau_rtp_conv.c b/src/trau/trau_rtp_conv.c
index 158a555..d795947 100644
--- a/src/trau/trau_rtp_conv.c
+++ b/src/trau/trau_rtp_conv.c
@@ -586,6 +586,10 @@
if ((data[0] & 0xF0) != 0xD0)
return -EINVAL;
+ /* bad frames are only allowed in UL */
+ if (bfi && tf->dir != OSMO_TRAU_DIR_UL)
+ return -EINVAL;
+
tf->type = OSMO_TRAU16_FT_FR;
/* FR Data Bits according to TS 48.060 Section 5.5.1.1.2 */
@@ -1002,6 +1006,10 @@
if ((data[0] & 0xF0) != 0xC0)
return -EINVAL;
+ /* bad frames are only allowed in UL */
+ if (bfi && tf->dir != OSMO_TRAU_DIR_UL)
+ return -EINVAL;
+
tf->type = OSMO_TRAU16_FT_EFR;
/* FR Data Bits according to TS 48.060 Section 5.5.1.1.2 */
@@ -1674,6 +1682,7 @@
* - RTP payload formats of RFC 5993, TW-TS-001 and TW-TS-002 are accepted
* by the function - however, all metadata flags carried by the header octet
* of these extended formats are ignored/dropped in the DL direction.
+ * BFI frames are not allowed in DL.
*
* - The most native RTP input formats for conversion to TRAU-DL are those
* defined in ETSI TS 101 318 for FR, HR and EFR; the ones for FR and EFR
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-abis/+/39625?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: Ic63943d4bde9902b27e4d8fe9a5fb6ccecbf36c6
Gerrit-Change-Number: 39625
Gerrit-PatchSet: 3
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>