From 66231badaf52abc31e258a8f49c19baf01a0de99 Mon Sep 17 00:00:00 2001 From: Guido Casati Date: Thu, 3 Oct 2024 12:35:08 +0200 Subject: [PATCH] Refactor PDU address IE in PDU Session Establishment Accept * take 3 bits for PDU session type value * add define for SMF's IPv6 link local address --- .../COMMON/ESM/MSG/PduSessionEstablishmentAccept.c | 12 +++++++++++- .../COMMON/ESM/MSG/PduSessionEstablishmentAccept.h | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c index 86aa3eaf7f..aee6d0e63d 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.c @@ -124,8 +124,18 @@ void capture_pdu_session_establishment_accept_msg(uint8_t *buffer, uint32_t msg_ case IEI_PDU_ADDRESS: LOG_T(NAS, "PDU SESSION ESTABLISHMENT ACCEPT - Received PDU Address IE\n"); psea_msg.pdu_addr_ie.pdu_length = *curPtr++; - psea_msg.pdu_addr_ie.pdu_type = *curPtr++; + /* Octet 3 */ + // PDU type (3 bits) + psea_msg.pdu_addr_ie.pdu_type = *curPtr & 0x07; + // SMF's IPv6 link local address (1 bit) + uint8_t si6lla = (*curPtr >> 3) & 0x01; + if (si6lla) + LOG_E(NAS, "SMF's IPv6 link local address is not handled\n"); + curPtr++; + + /* Octet 4 to n */ + // PDU address information uint8_t *addr = psea_msg.pdu_addr_ie.pdu_addr_oct; if (psea_msg.pdu_addr_ie.pdu_type == PDU_SESSION_TYPE_IPV4) { for (int i = 0; i < IPv4_ADDRESS_LENGTH; ++i) diff --git a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h index e655607d9c..c283079998 100644 --- a/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h +++ b/openair3/NAS/COMMON/ESM/MSG/PduSessionEstablishmentAccept.h @@ -44,6 +44,7 @@ #define PDU_SESSION_TYPE_IPV4V6 0b011 #define IPv4_ADDRESS_LENGTH 4 // length of the IPv4 address associated with a PDU session #define IPv6_INTERFACE_ID_LENGTH 8 // interface identifier for the IPv6 link local address +#define SMF_IPv6_LLA_LENGTH 16 /* Rule operation codes - TS 24.501 Table 9.11.4.13.1 */