Attention is currently required from: falconia. pespin has posted comments on this change by falconia. ( https://gerrit.osmocom.org/c/libosmo-abis/+/39626?usp=email )
Change subject: rtp2trau HR to DL: validate ToC octet of RFC 5993 ...................................................................... Patch Set 1: (1 comment) File src/trau/trau_rtp_conv.c: https://gerrit.osmocom.org/c/libosmo-abis/+/39626/comment/63160a5f_43132f69?usp=email : PS1, Line 671: if (data[0] & 0xD0) > The objective is to accept 0x00 or 0x20 and no others in the upper nibble, > while accepting anything […] well, the purpose precisely is that I don't have to look at the exact structure of that byte each time I'm checking this code. But if it makes it a lot easier then fine. Maybe adding a quick reference to the byte structure in the comment would be enough. I would at least add a reference to the specific section of RFC 5993 where I could fine the byte structure. Something like (again I didn't really look at the structure): #define RFC_5993_HDR_F_BITMASK (0x01 << 3) #define RFC_5993_HDR_FT_BITMASK (0x0f << 4) #define RFC_5993_HDR_FT(num) (num << 5) if (data[0] & RFC_5993_HDR_F_BITMASK) return -EINVAL; if ((data[0] & RFC_5993_HDR_FT_BITMASK) != RFC_5993_HDR_FT(0) || (data[0] & RFC_5993_HDR_FT_BITMASK) != RFC_5993_HDR_FT(2)) return -EINVAL; This are just suggestions, feel free to improve as you see. -- To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/39626?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Change-Id: Ibbaa1e1e12254eaf75a999dd1b58e2145eff158c Gerrit-Change-Number: 39626 Gerrit-PatchSet: 1 Gerrit-Owner: falconia <fal...@freecalypso.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pes...@sysmocom.de> Gerrit-Attention: falconia <fal...@freecalypso.org> Gerrit-Comment-Date: Wed, 26 Feb 2025 19:34:40 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: falconia <fal...@freecalypso.org> Comment-In-Reply-To: pespin <pes...@sysmocom.de>