mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
fix (NAS UE): account for Service Request encoder length
Fix remaining length tracking in Service Request encoding so IE encoding uses the proper buffer budget per step. Changes: - decrement `len` by fixed per-field sizes instead of cumulative `encoded` Refs: - TS 24.501 8.2.16 (Service request) Signed-off-by: Guido Casati <guido.casati@openairinterface.org>
This commit is contained in:
@@ -33,11 +33,11 @@ int encode_fgs_service_request(uint8_t *buffer, const fgs_service_request_msg_t
|
|||||||
*buffer = ((encode_nas_key_set_identifier(&service_request->naskeysetidentifier, IEI_NULL) & 0x0f) << 4)
|
*buffer = ((encode_nas_key_set_identifier(&service_request->naskeysetidentifier, IEI_NULL) & 0x0f) << 4)
|
||||||
| (service_request->serviceType & 0x0f);
|
| (service_request->serviceType & 0x0f);
|
||||||
encoded++;
|
encoded++;
|
||||||
len -= encoded;
|
len -= 1;
|
||||||
|
|
||||||
// 5GS Mobile Identity (M) type 5G-S-TMSI (9 octets)
|
// 5GS Mobile Identity (M) type 5G-S-TMSI (9 octets)
|
||||||
encoded += LEN_FGS_MOBILE_ID_CONTENTS_SIZE; // skip "Length of 5GS mobile identity contents" IE
|
encoded += LEN_FGS_MOBILE_ID_CONTENTS_SIZE; // skip "Length of 5GS mobile identity contents" IE
|
||||||
len -= encoded;
|
len -= LEN_FGS_MOBILE_ID_CONTENTS_SIZE;
|
||||||
encoded += encode_stmsi_5gs_mobile_identity(buffer + encoded, &service_request->fiveg_s_tmsi, len);
|
encoded += encode_stmsi_5gs_mobile_identity(buffer + encoded, &service_request->fiveg_s_tmsi, len);
|
||||||
// encode length of 5GS mobile identity contents
|
// encode length of 5GS mobile identity contents
|
||||||
uint16_t tmp = htons(encoded - LEN_FGS_MOBILE_ID_CONTENTS_SIZE - 1);
|
uint16_t tmp = htons(encoded - LEN_FGS_MOBILE_ID_CONTENTS_SIZE - 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user