From bfe214aafa3db9e3f6a6da300cba20d9a2b175c6 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Thu, 23 Jun 2022 15:04:01 +0200 Subject: [PATCH] [UPF] Avoid crash if no default subnet configured (#1624) In that case, ogs_pfcp_ue_ip_alloc() will fail with the error message "CHECK CONFIGURATION: Cannot find subnet [...]" and the assert will make upf crash. That's not desirable, let's keep it running and simply reject the request. The error log is big enoguh to find out. --- src/upf/n4-handler.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/upf/n4-handler.c b/src/upf/n4-handler.c index 6396953a1..f8b45f2a9 100644 --- a/src/upf/n4-handler.c +++ b/src/upf/n4-handler.c @@ -119,8 +119,9 @@ void upf_n4_handle_session_establishment_request( /* Setup UE IP address */ if (pdr->ue_ip_addr_len) { if (req->pdn_type.presence == 1) { - ogs_assert(OGS_PFCP_CAUSE_REQUEST_ACCEPTED == - upf_sess_set_ue_ip(sess, req->pdn_type.u8, pdr)); + cause_value = upf_sess_set_ue_ip(sess, req->pdn_type.u8, pdr); + if (cause_value != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) + goto cleanup; } else { ogs_error("No PDN Type"); }