From 933984fab1ef8dca2b404c0803ab39089893201e Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Tue, 24 Feb 2026 08:37:36 +0100 Subject: [PATCH] Fix handling of IPv4v6 PDU sessions The code previously checked that the supplied PDU sessions's type is exactly what we requested. However, at least OAI 5GC will only give us an IPv4 PDU session if we request IPv4v6 (so the check would fail). Extend the validation to either check exact match, or, if IPv4v6 requested, that it is either IPv4 or IPv6. --- openair3/NAS/NR_UE/nr_nas_msg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openair3/NAS/NR_UE/nr_nas_msg.c b/openair3/NAS/NR_UE/nr_nas_msg.c index 64f9feef54..b52bb982fc 100644 --- a/openair3/NAS/NR_UE/nr_nas_msg.c +++ b/openair3/NAS/NR_UE/nr_nas_msg.c @@ -1556,7 +1556,9 @@ static void handle_pdu_session_accept(const nr_ue_nas_t *nas, uint8_t *pdu_buffe int idx; for (idx = 0; idx < nas->uicc->n_pdu_sessions; ++idx) { const pdu_session_config_t *pdu = &nas->uicc->pdu_sessions[idx]; - if (pdu->id == sm_header.pdu_session_id && pdu->type == msg.pdu_type) + bool msg_ipv4or6 = msg.pdu_type == PDU_SESSION_TYPE_IPV4 || msg.pdu_type == PDU_SESSION_TYPE_IPV6; + bool correct_type = pdu->type == msg.pdu_type || (pdu->type == PDU_SESSION_TYPE_IPV4V6 && msg_ipv4or6); + if (pdu->id == sm_header.pdu_session_id && correct_type) break; } if (idx == nas->uicc->n_pdu_sessions) {