[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.
This commit is contained in:
Pau Espin 2022-06-23 15:04:01 +02:00 committed by GitHub
parent 96d689a402
commit bfe214aafa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -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");
}