neels has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-pfcp/+/36347?usp=email )

Change subject: pfcp up_function_features: allow shorter lengths
......................................................................

pfcp up_function_features: allow shorter lengths

eUPF sends a short CP Function Features bitmap, which is easy to solve
by just zero padding to the minimum length specified in PFCP (3GPP TS
29.244)

Related: SYS#6590
Change-Id: I40e255fd0b4770e578aea7a10ba88f5eeba087f4
---
M src/libosmo-pfcp/pfcp_ies_custom.c
1 file changed, 18 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved




diff --git a/src/libosmo-pfcp/pfcp_ies_custom.c 
b/src/libosmo-pfcp/pfcp_ies_custom.c
index e2e9f02..d3ecda5 100644
--- a/src/libosmo-pfcp/pfcp_ies_custom.c
+++ b/src/libosmo-pfcp/pfcp_ies_custom.c
@@ -431,8 +431,10 @@
 int osmo_pfcp_dec_up_function_features(void *decoded_struct, void *decode_to, 
const struct osmo_gtlv_load *tlv)
 {
        struct osmo_pfcp_ie_up_function_features *up_function_features = 
decode_to;
-       ENSURE_LENGTH_IS_AT_LEAST(6);
-       memcpy(up_function_features->bits, tlv->val, 6);
+       /* 3GPP TS 29.244 version 16.6.0 Release 16 8.2.25 UP Function Features 
defines at least 6 octets of bits, but
+        * if the peer sends less octets, make do with what we get. */
+       memset(up_function_features->bits, 0, 
sizeof(up_function_features->bits));
+       memcpy(up_function_features->bits, tlv->val, 
OSMO_MIN(sizeof(up_function_features->bits), tlv->len));
        return 0;
 }


--
To view, visit https://gerrit.osmocom.org/c/libosmo-pfcp/+/36347?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-pfcp
Gerrit-Branch: master
Gerrit-Change-Id: I40e255fd0b4770e578aea7a10ba88f5eeba087f4
Gerrit-Change-Number: 36347
Gerrit-PatchSet: 1
Gerrit-Owner: neels <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to