Commit 44652b3 1 parent 0ed8355 commit 44652b3 Copy full SHA for 44652b3
File tree 6 files changed +19
-11
lines changed
6 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -370,8 +370,9 @@ static ogs_pfcp_node_t *selected_sgwu_node(
370
370
}
371
371
}
372
372
373
+ // If we get here, it means no suitable UPF can be found
373
374
ogs_error ("No SGWUs are PFCP associated that are suited to RR" );
374
- return ogs_list_first ( & ogs_pfcp_self () -> pfcp_peer_list ) ;
375
+ return NULL ;
375
376
}
376
377
377
378
void sgwc_sess_select_sgwu (sgwc_sess_t * sess )
@@ -391,6 +392,11 @@ void sgwc_sess_select_sgwu(sgwc_sess_t *sess)
391
392
/* setup GTP session with selected SGW-U */
392
393
ogs_pfcp_self ()-> pfcp_node =
393
394
selected_sgwu_node (ogs_pfcp_self ()-> pfcp_node , sess );
395
+
396
+ if (ogs_pfcp_self ()-> pfcp_node == NULL ) {
397
+ return ;
398
+ }
399
+
394
400
ogs_assert (ogs_pfcp_self ()-> pfcp_node );
395
401
OGS_SETUP_PFCP_NODE (sess , ogs_pfcp_self ()-> pfcp_node );
396
402
ogs_debug ("UE using SGW-U on IP[%s]" ,
Original file line number Diff line number Diff line change @@ -298,8 +298,7 @@ void sgwc_s11_handle_create_session_request(
298
298
sgwc_sess_select_sgwu (sess );
299
299
300
300
/* Check if selected SGW-U is associated with SGW-C */
301
- ogs_assert (sess -> pfcp_node );
302
- if (!OGS_FSM_CHECK (& sess -> pfcp_node -> sm , sgwc_pfcp_state_associated )) {
301
+ if (!sess -> pfcp_node || !OGS_FSM_CHECK (& sess -> pfcp_node -> sm , sgwc_pfcp_state_associated )) {
303
302
ogs_gtp_send_error_message (
304
303
s11_xact , sgwc_ue ? sgwc_ue -> mme_s11_teid : 0 ,
305
304
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
+ // If we get here, it means no suitable UPF can be found
994
995
ogs_error ("No UPFs are PFCP associated that are suited to RR" );
995
- return ogs_list_first ( & ogs_pfcp_self () -> pfcp_peer_list ) ;
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 @@ -245,8 +245,7 @@ uint8_t smf_s5c_handle_create_session_request(
245
245
smf_sess_select_upf (sess );
246
246
247
247
/* Check if selected PGW is associated with SMF */
248
- ogs_assert (sess -> pfcp_node );
249
- if (!OGS_FSM_CHECK (& sess -> pfcp_node -> sm , smf_pfcp_state_associated ))
248
+ if (!sess -> pfcp_node || !OGS_FSM_CHECK (& sess -> pfcp_node -> sm , smf_pfcp_state_associated ))
250
249
return OGS_GTP2_CAUSE_REMOTE_PEER_NOT_RESPONDING ;
251
250
252
251
/* UE IP Address */
You can’t perform that action at this time.
0 commit comments