Attention is currently required from: dexter.
pespin has posted comments on this change. (
https://gerrit.osmocom.org/c/osmo-bts/+/32630
)
Change subject: l1sap: Accept RFC5993 and TS 101.318 HR GSM payload
......................................................................
Patch Set 4:
(1 comment)
File src/common/l1sap.c:
https://gerrit.osmocom.org/c/osmo-bts/+/32630/comment/18e89d11_debaf3f0
PS4, Line 1955: /* Since we already verified the payload in rtppayload_validate_hr(), we
may trust that the payload length is
I meant something like this (assuming no weird lengths like len=0 are to be received
here):
```
switch (rtp_pl_len) {
case GSM_HR_BYTES_RTP_TS101318:
/* Convert from TS 101 318 to RFC 5993 */
if (OSMO_UNLIKELY(!ts101318 && rfc5993)) {
msg = l1sap_msgb_alloc(rtp_pl_len + 1);
if (!msg)
return NULL;
msgb_put_u8(msg, 0x00);
memcpy(msgb_put(msg, rtp_pl_len), rtp_pl, rtp_pl_len);
return msg;
}
break;
case GSM_HR_BYTES_RTP_RFC5993:
/* Convert from RFC 5993 TS 101 318 */
if (OSMO_UNLIKELY(!rfc5993 && ts101318)) {
msg = l1sap_msgb_alloc(rtp_pl_len - 1);
if (!msg)
return NULL;
memcpy(msgb_put(msg, rtp_pl_len - 1), rtp_pl + 1, rtp_pl_len - 1);
return msg;
}
break;
default:
OSMO_ASSERT(0);
}
/* No conversion needed since the RTP payload is already in a supported format */
msg = l1sap_msgb_alloc(rtp_pl_len);
if (!msg)
return NULL;
memcpy(msgb_put(msg, rtp_pl_len), rtp_pl, rtp_pl_len);
```
--
To view, visit
https://gerrit.osmocom.org/c/osmo-bts/+/32630
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I9419b40c1171876879d41aba4f51c93e8ef5673c
Gerrit-Change-Number: 32630
Gerrit-PatchSet: 4
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 17 May 2023 14:52:37 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment