Commit 438788c 1 parent c260f7c commit 438788c Copy full SHA for 438788c
File tree 6 files changed +21
-13
lines changed
6 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -367,8 +367,9 @@ static ogs_pfcp_node_t *selected_sgwu_node(
367
367
}
368
368
}
369
369
370
- ogs_error ("No SGWUs are PFCP associated that are suited to RR" );
371
- return ogs_list_first (& ogs_pfcp_self ()-> pfcp_peer_list );
370
+ // If we get here, it means no suitable SGWU can be found
371
+ ogs_error ("No SGWUs are PFCP associated that are suited to RR for UE TAC %u" , sess -> sgwc_ue -> e_tai .tac );
372
+ return NULL ;
372
373
}
373
374
374
375
void sgwc_sess_select_sgwu (sgwc_sess_t * sess )
@@ -388,6 +389,11 @@ void sgwc_sess_select_sgwu(sgwc_sess_t *sess)
388
389
/* setup GTP session with selected SGW-U */
389
390
ogs_pfcp_self ()-> pfcp_node =
390
391
selected_sgwu_node (ogs_pfcp_self ()-> pfcp_node , sess );
392
+
393
+ if (ogs_pfcp_self ()-> pfcp_node == NULL ) {
394
+ return ;
395
+ }
396
+
391
397
ogs_assert (ogs_pfcp_self ()-> pfcp_node );
392
398
OGS_SETUP_PFCP_NODE (sess , ogs_pfcp_self ()-> pfcp_node );
393
399
ogs_debug ("UE using SGW-U on IP[%s]" ,
Original file line number Diff line number Diff line change @@ -258,8 +258,7 @@ void sgwc_s11_handle_create_session_request(
258
258
sgwc_sess_select_sgwu (sess );
259
259
260
260
/* Check if selected SGW-U is associated with SGW-C */
261
- ogs_assert (sess -> pfcp_node );
262
- if (!OGS_FSM_CHECK (& sess -> pfcp_node -> sm , sgwc_pfcp_state_associated )) {
261
+ if (!sess -> pfcp_node || !OGS_FSM_CHECK (& sess -> pfcp_node -> sm , sgwc_pfcp_state_associated )) {
263
262
ogs_gtp_send_error_message (
264
263
s11_xact , sgwc_ue ? sgwc_ue -> mme_s11_teid : 0 ,
265
264
OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE ,
Original file line number Diff line number Diff line change @@ -991,8 +991,9 @@ static ogs_pfcp_node_t *selected_upf_node(
991
991
}
992
992
}
993
993
994
- ogs_error ("No UPFs are PFCP associated that are suited to RR" );
995
- return ogs_list_first (& ogs_pfcp_self ()-> pfcp_peer_list );
994
+ // If we get here, it means no suitable UPF can be found
995
+ ogs_error ("No UPFs are PFCP associated that are suited to RR for UE TAC %u" , sess -> e_tai .tac );
996
+ return NULL ;
996
997
}
997
998
998
999
void smf_sess_select_upf (smf_sess_t * sess )
@@ -1012,6 +1013,11 @@ void smf_sess_select_upf(smf_sess_t *sess)
1012
1013
/* setup GTP session with selected UPF */
1013
1014
ogs_pfcp_self ()-> pfcp_node =
1014
1015
selected_upf_node (ogs_pfcp_self ()-> pfcp_node , sess );
1016
+
1017
+ if (ogs_pfcp_self ()-> pfcp_node == NULL ) {
1018
+ return ;
1019
+ }
1020
+
1015
1021
ogs_assert (ogs_pfcp_self ()-> pfcp_node );
1016
1022
OGS_SETUP_PFCP_NODE (sess , ogs_pfcp_self ()-> pfcp_node );
1017
1023
ogs_debug ("UE using UPF on IP[%s]" ,
Original file line number Diff line number Diff line change @@ -258,10 +258,9 @@ uint8_t smf_gn_handle_create_pdp_context_request(
258
258
smf_sess_select_upf (sess );
259
259
260
260
/* Check if selected PGW is associated with SMF */
261
- ogs_assert (sess -> pfcp_node );
262
- if (!OGS_FSM_CHECK (& sess -> pfcp_node -> sm , smf_pfcp_state_associated ))
261
+ if (!sess -> pfcp_node || !OGS_FSM_CHECK (& sess -> pfcp_node -> sm , smf_pfcp_state_associated ))
263
262
return OGS_GTP1_CAUSE_NO_RESOURCES_AVAILABLE ;
264
-
263
+
265
264
if ((pfcp_cause = smf_sess_set_ue_ip (sess )) != OGS_PFCP_CAUSE_REQUEST_ACCEPTED ) {
266
265
cause_value = gtp_cause_from_pfcp (pfcp_cause , 1 );
267
266
return cause_value ;
Original file line number Diff line number Diff line change @@ -445,8 +445,7 @@ bool smf_npcf_smpolicycontrol_handle_create(
445
445
smf_sess_select_upf (sess );
446
446
447
447
/* Check if selected UPF is associated with SMF */
448
- ogs_assert (sess -> pfcp_node );
449
- if (!OGS_FSM_CHECK (& sess -> pfcp_node -> sm , smf_pfcp_state_associated )) {
448
+ if (!sess -> pfcp_node || !OGS_FSM_CHECK (& sess -> pfcp_node -> sm , smf_pfcp_state_associated )) {
450
449
ogs_error ("[%s] No associated UPF" , smf_ue -> supi );
451
450
return false;
452
451
}
Original file line number Diff line number Diff line change @@ -234,8 +234,7 @@ uint8_t smf_s5c_handle_create_session_request(
234
234
smf_sess_select_upf (sess );
235
235
236
236
/* Check if selected PGW is associated with SMF */
237
- ogs_assert (sess -> pfcp_node );
238
- if (!OGS_FSM_CHECK (& sess -> pfcp_node -> sm , smf_pfcp_state_associated ))
237
+ if (!sess -> pfcp_node || !OGS_FSM_CHECK (& sess -> pfcp_node -> sm , smf_pfcp_state_associated ))
239
238
return OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING ;
240
239
241
240
/* UE IP Address */
You can’t perform that action at this time.
0 commit comments