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.
This commit is contained in:
Robert Schmidt
2026-02-24 08:37:36 +01:00
parent 520360a629
commit 933984fab1
+3 -1
View File
@@ -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) {