Projects
osmocom:nightly
open5gs
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 1251
View file
open5gs_2.7.6.4816.15b1.202511251800.dsc -> open5gs_2.7.6.4819.964b.202511261800.dsc
Changed
@@ -2,7 +2,7 @@ Source: open5gs Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-scp, open5gs-sepp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg Architecture: any -Version: 2.7.6.4816.15b1.202511251800 +Version: 2.7.6.4819.964b.202511261800 Maintainer: Harald Welte <laforge@gnumonks.org> Uploaders: Sukchan Lee <acetcom@gmail.com> Homepage: https://open5gs.org @@ -32,8 +32,8 @@ open5gs-udr deb net optional arch=any open5gs-upf deb net optional arch=any Checksums-Sha1: - a903ed67d995034ce60b71cfbb57b112de627055 15091936 open5gs_2.7.6.4816.15b1.202511251800.tar.xz + 0eea054b149bb517776b3b805cd8c183a95d3d70 15093588 open5gs_2.7.6.4819.964b.202511261800.tar.xz Checksums-Sha256: - e1ca1613ead9a59d7f5d22cdd20985a8992314b7fc32fb0608e8d30f4405cc93 15091936 open5gs_2.7.6.4816.15b1.202511251800.tar.xz + 0705f8bb038d2b464d849edc9e6c350a3c5d012e20549e665631316fc7dd36be 15093588 open5gs_2.7.6.4819.964b.202511261800.tar.xz Files: - 2bef880bf5e09e4316e7bcf90b21fbab 15091936 open5gs_2.7.6.4816.15b1.202511251800.tar.xz + caed595ebbcedda625f0e4fac37c44f5 15093588 open5gs_2.7.6.4819.964b.202511261800.tar.xz
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/.tarball-version -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/.tarball-version
Changed
@@ -1 +1 @@ -2.7.6.4816-15b1.202511251800 +2.7.6.4819-964b.202511261800
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/debian/changelog -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -open5gs (2.7.6.4816.15b1.202511251800) unstable; urgency=medium +open5gs (2.7.6.4819.964b.202511261800) unstable; urgency=medium * Automatically generated changelog entry for building the Osmocom nightly feed - -- Osmocom OBS scripts <info@osmocom.org> Tue, 25 Nov 2025 18:01:55 +0000 + -- Osmocom OBS scripts <info@osmocom.org> Wed, 26 Nov 2025 18:01:55 +0000 open5gs (2.7.6) unstable; urgency=medium
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/lib/sbi/context.h -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/lib/sbi/context.h
Changed
@@ -275,6 +275,9 @@ ogs_sbi_object_t *sbi_object; ogs_pool_id_t sbi_object_id; + +#define OGS_SBI_MAX_NUM_OF_ASSOC_ID 4 + ogs_pool_id_t assoc_idOGS_SBI_MAX_NUM_OF_ASSOC_ID; } ogs_sbi_xact_t; typedef struct ogs_sbi_nf_service_s {
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/amf/amf-sm.c -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/amf/amf-sm.c
Changed
@@ -68,6 +68,7 @@ ogs_sbi_xact_t *sbi_xact = NULL; ogs_pool_id_t sbi_xact_id = OGS_INVALID_POOL_ID; int state = AMF_CREATE_SM_CONTEXT_NO_STATE; + ogs_pool_id_t assoc_ran_ue_id = OGS_INVALID_POOL_ID; ogs_sbi_stream_t *stream = NULL; ogs_pool_id_t stream_id = OGS_INVALID_POOL_ID; ogs_sbi_request_t *sbi_request = NULL; @@ -517,6 +518,8 @@ ogs_assert(sbi_object_id >= OGS_MIN_POOL_ID && sbi_object_id <= OGS_MAX_POOL_ID); + assoc_ran_ue_id = sbi_xact->assoc_idAMF_ASSOC_RAN_UE_ID; + ogs_sbi_xact_remove(sbi_xact); sess = amf_sess_find_by_id(sbi_object_id); @@ -565,14 +568,14 @@ ogs_assert(OGS_FSM_STATE(&amf_ue->sm)); - e->amf_ue_id = amf_ue->id; - e->sess_id = sess->id; - e->h.sbi.message = &sbi_message;; + if (assoc_ran_ue_id >= OGS_MIN_POOL_ID && + assoc_ran_ue_id <= OGS_MAX_POOL_ID) + ran_ue = ran_ue_find_by_id(assoc_ran_ue_id); SWITCH(sbi_message.h.resource.component2) CASE(OGS_SBI_RESOURCE_NAME_MODIFY) amf_nsmf_pdusession_handle_update_sm_context( - sess, state, &sbi_message); + amf_ue, ran_ue, sess, state, &sbi_message); break; CASE(OGS_SBI_RESOURCE_NAME_RELEASE) @@ -584,12 +587,13 @@ ogs_error("%s:%d HTTP response error %d", amf_ue->supi, sess->psi, sbi_message.res_status); } - amf_nsmf_pdusession_handle_release_sm_context(sess, state); + amf_nsmf_pdusession_handle_release_sm_context( + amf_ue, ran_ue, sess, state); break; DEFAULT rv = amf_nsmf_pdusession_handle_create_sm_context( - sess, &sbi_message); + amf_ue, ran_ue, sess, &sbi_message); if (rv != OGS_OK) { /* * 1. First PDU session establishment request @@ -635,6 +639,8 @@ ogs_assert(sbi_object_id >= OGS_MIN_POOL_ID && sbi_object_id <= OGS_MAX_POOL_ID); + assoc_ran_ue_id = sbi_xact->assoc_idAMF_ASSOC_RAN_UE_ID; + state = sbi_xact->state; ogs_sbi_xact_remove(sbi_xact); @@ -653,12 +659,12 @@ ogs_assert(OGS_FSM_STATE(&amf_ue->sm)); - e->amf_ue_id = amf_ue->id; - e->sess_id = sess->id; - e->h.sbi.message = &sbi_message;; - e->h.sbi.state = state; + if (assoc_ran_ue_id >= OGS_MIN_POOL_ID && + assoc_ran_ue_id <= OGS_MAX_POOL_ID) + ran_ue = ran_ue_find_by_id(assoc_ran_ue_id); - amf_nnssf_nsselection_handle_get(sess, state, &sbi_message); + amf_nnssf_nsselection_handle_get( + amf_ue, ran_ue, sess, state, &sbi_message); break; DEFAULT @@ -764,6 +770,8 @@ ogs_assert(sbi_object_id >= OGS_MIN_POOL_ID && sbi_object_id <= OGS_MAX_POOL_ID); + assoc_ran_ue_id = sbi_xact->assoc_idAMF_ASSOC_RAN_UE_ID; + service_type = sbi_xact->service_type; requester_nf_type = sbi_xact->requester_nf_type; discovery_option = sbi_xact->discovery_option; @@ -838,7 +846,13 @@ ogs_error("%s:%s:%d:%d Cannot receive SBI message", amf_ue->supi, amf_ue->suci, sess->psi, sess->pti); - ran_ue = ran_ue_find_by_id(sess->ran_ue_id); + if (assoc_ran_ue_id < OGS_MIN_POOL_ID && + assoc_ran_ue_id > OGS_MAX_POOL_ID) { + ogs_error("No assoc RAN-UE id %d", assoc_ran_ue_id); + break; + } + + ran_ue = ran_ue_find_by_id(assoc_ran_ue_id); if (!ran_ue) { ogs_error("%s:%s:%d:%d " "NG Context has already been removed", @@ -862,14 +876,14 @@ if (sess->payload_container_type) { r = nas_5gs_send_back_gsm_message( - ran_ue_find_by_id(sess->ran_ue_id), sess, + ran_ue, sess, OGS_5GMM_CAUSE_PAYLOAD_WAS_NOT_FORWARDED, AMF_NAS_BACKOFF_TIME); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); } else { r = ngap_send_error_indication2( - ran_ue_find_by_id(sess->ran_ue_id), + ran_ue, NGAP_Cause_PR_transport, NGAP_CauseTransport_transport_resource_unavailable); ogs_expect(r == OGS_OK);
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/amf/context.c -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/amf/context.c
Changed
@@ -2531,7 +2531,9 @@ ogs_assert(list1->taij.type == OGS_TAI1_TYPE); ogs_assert(list1->taij.num <= OGS_MAX_NUM_OF_TAI); - if (list1->taij.tac.v <= nr_tai->tac.v && + if (memcmp(&list1->taij.plmn_id, + &nr_tai->plmn_id, OGS_PLMN_ID_LEN) == 0 && + list1->taij.tac.v <= nr_tai->tac.v && nr_tai->tac.v < (list1->taij.tac.v+list1->taij.num)) return i; }
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/amf/context.h -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/amf/context.h
Changed
@@ -909,8 +909,29 @@ /* amf_bearer_first(sess) : Default Bearer Context */ ogs_list_t bearer_list; - /* Related Context */ + /* AMF-UE identifier associated with this session. */ ogs_pool_id_t amf_ue_id; + + /* + * RAN-UE identifier associated with this session. + * + * IMPORTANT: + * - During SBI Client operations (e.g., AMF sending requests to SMF/PCF), + * the RAN-UE may change before the asynchronous SBI response arrives + * (e.g., NG Context release/re-establishment). Because of this, the + * SBI transaction (ogs_sbi_xact_t) stores its own snapshot of the + * RAN-UE ID inside xact->assoc_id. + * + * When processing SBI Client responses, the AMF must use the snapshot + * stored in xact->assoc_idAMF_ASSOC_RAN_UE_ID instead of + * this session field. + * + * - For SBI Server operations (e.g., Namf callbacks where the AMF + * receives requests from SMF), there is no transaction-specific + * snapshot. In such cases, the current session value (sess->ran_ue_id) + * is used. + */ +#define AMF_ASSOC_RAN_UE_ID 1 ogs_pool_id_t ran_ue_id; ogs_s_nssai_t s_nssai;
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/amf/namf-handler.c -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/amf/namf-handler.c
Changed
@@ -595,6 +595,7 @@ sess->n2_released == true && sess->resource_status == OpenAPI_resource_status_RELEASED) { amf_nsmf_pdusession_handle_release_sm_context( + amf_ue, ran_ue_find_by_id(sess->ran_ue_id), sess, AMF_RELEASE_SM_CONTEXT_NO_STATE); }
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/amf/nnrf-handler.c -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/amf/nnrf-handler.c
Changed
@@ -36,6 +36,7 @@ ogs_sbi_discovery_option_t *discovery_option = NULL; amf_ue_t *amf_ue = NULL; + ran_ue_t *ran_ue = NULL; amf_sess_t *sess = NULL; OpenAPI_search_result_t *SearchResult = NULL; @@ -72,6 +73,11 @@ ogs_assert(sess); amf_ue = amf_ue_find_by_id(sess->amf_ue_id); ogs_assert(amf_ue); + + ogs_assert(xact->assoc_idAMF_ASSOC_RAN_UE_ID >= OGS_MIN_POOL_ID && + xact->assoc_idAMF_ASSOC_RAN_UE_ID <= OGS_MAX_POOL_ID); + ran_ue = ran_ue_find_by_id(xact->assoc_idAMF_ASSOC_RAN_UE_ID); + ogs_assert(ran_ue); } else { ogs_fatal("(NF discover) Not implemented %s:%d", ogs_sbi_service_type_to_name(service_type), sbi_object->type); @@ -127,14 +133,14 @@ ogs_sbi_service_type_to_name(service_type)); if (sess->payload_container_type) { r = nas_5gs_send_back_gsm_message( - ran_ue_find_by_id(sess->ran_ue_id), sess, + ran_ue, sess, OGS_5GMM_CAUSE_PAYLOAD_WAS_NOT_FORWARDED, AMF_NAS_BACKOFF_TIME); ogs_expect(r == OGS_OK); ogs_assert(r != OGS_ERROR); } else { r = ngap_send_error_indication2( - ran_ue_find_by_id(sess->ran_ue_id), + ran_ue, NGAP_Cause_PR_transport, NGAP_CauseTransport_transport_resource_unavailable); ogs_expect(r == OGS_OK);
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/amf/nnssf-handler.c -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/amf/nnssf-handler.c
Changed
@@ -22,7 +22,8 @@ #include "sbi-path.h" int amf_nnssf_nsselection_handle_get( - amf_sess_t *sess, int state, ogs_sbi_message_t *recvmsg) + amf_ue_t *amf_ue, ran_ue_t *ran_ue, amf_sess_t *sess, + int state, ogs_sbi_message_t *recvmsg) { bool rc; int r, i; @@ -36,9 +37,6 @@ OpenAPI_authorized_network_slice_info_t *AuthorizedNetworkSliceInfo = NULL; OpenAPI_nsi_information_t *NsiInformation = NULL; - amf_ue_t *amf_ue = NULL; - ran_ue_t *ran_ue = NULL; - ogs_assert(state); ogs_assert(recvmsg); ogs_assert(!SESSION_CONTEXT_IN_SMF(sess)); @@ -48,13 +46,11 @@ return OGS_ERROR; } - amf_ue = amf_ue_find_by_id(sess->amf_ue_id); if (!amf_ue) { ogs_error("UE(amf_ue) Context has already been removed"); return OGS_ERROR; } - ran_ue = ran_ue_find_by_id(sess->ran_ue_id); if (!ran_ue) { ogs_error("%s RAN-NG Context has already been removed", amf_ue->supi); return OGS_ERROR;
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/amf/nnssf-handler.h -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/amf/nnssf-handler.h
Changed
@@ -27,7 +27,8 @@ #include "context.h" int amf_nnssf_nsselection_handle_get( - amf_sess_t *sess, int state, ogs_sbi_message_t *recvmsg); + amf_ue_t *amf_ue, ran_ue_t *ran_ue, amf_sess_t *sess, + int state, ogs_sbi_message_t *recvmsg); #ifdef __cplusplus }
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/amf/nsmf-handler.c -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/amf/nsmf-handler.c
Changed
@@ -25,13 +25,11 @@ #include "gmm-build.h" int amf_nsmf_pdusession_handle_create_sm_context( - amf_sess_t *sess, ogs_sbi_message_t *recvmsg) + amf_ue_t *amf_ue, ran_ue_t *ran_ue, amf_sess_t *sess, + ogs_sbi_message_t *recvmsg) { int rv, r; - amf_ue_t *amf_ue = NULL; - ran_ue_t *ran_ue = NULL; - ogs_assert(recvmsg); if (!sess) { @@ -39,13 +37,11 @@ return OGS_ERROR; } - amf_ue = amf_ue_find_by_id(sess->amf_ue_id); if (!amf_ue) { ogs_error("UE(amf_ue) Context has already been removed"); return OGS_ERROR; } - ran_ue = ran_ue_find_by_id(sess->ran_ue_id); if (!ran_ue) { ogs_error("%s RAN-NG Context has already been removed", amf_ue->supi); return OGS_ERROR; @@ -246,13 +242,11 @@ } int amf_nsmf_pdusession_handle_update_sm_context( - amf_sess_t *sess, int state, ogs_sbi_message_t *recvmsg) + amf_ue_t *amf_ue, ran_ue_t *ran_ue, amf_sess_t *sess, + int state, ogs_sbi_message_t *recvmsg) { int r; - amf_ue_t *amf_ue = NULL; - ran_ue_t *ran_ue = NULL; - ogs_assert(recvmsg); if (!sess) { @@ -260,14 +254,11 @@ return OGS_ERROR; } - amf_ue = amf_ue_find_by_id(sess->amf_ue_id); if (!amf_ue) { ogs_error("UE(amf_ue) Context has already been removed"); return OGS_ERROR; } - ran_ue = ran_ue_find_by_id(sess->ran_ue_id); - if (recvmsg->res_status == OGS_SBI_HTTP_STATUS_NO_CONTENT || recvmsg->res_status == OGS_SBI_HTTP_STATUS_OK) { @@ -741,11 +732,10 @@ } else if (state == AMF_UPDATE_SM_CONTEXT_HANDOVER_CANCEL) { if (AMF_SESSION_SYNC_DONE(amf_ue, state)) { - ran_ue_t *source_ue = NULL, *target_ue = NULL; + ran_ue_t *target_ue = NULL; - source_ue = ran_ue_find_by_id(sess->ran_ue_id); - ogs_assert(source_ue); - target_ue = ran_ue_find_by_id(source_ue->target_ue_id); + ogs_assert(ran_ue); + target_ue = ran_ue_find_by_id(ran_ue->target_ue_id); if (target_ue) { r = ngap_send_ran_ue_context_release_command( target_ue, @@ -954,7 +944,7 @@ sess->n2_released == true && sess->resource_status == OpenAPI_resource_status_RELEASED) { amf_nsmf_pdusession_handle_release_sm_context( - sess, AMF_RELEASE_SM_CONTEXT_NO_STATE); + amf_ue, ran_ue, sess, AMF_RELEASE_SM_CONTEXT_NO_STATE); } } } else { @@ -1106,25 +1096,21 @@ return OGS_OK; } -int amf_nsmf_pdusession_handle_release_sm_context(amf_sess_t *sess, int state) +int amf_nsmf_pdusession_handle_release_sm_context( + amf_ue_t *amf_ue, ran_ue_t *ran_ue, amf_sess_t *sess, int state) { int r; - amf_ue_t *amf_ue = NULL; - ran_ue_t *ran_ue = NULL; if (!sess) { ogs_error("Session has already been removed"); return OGS_ERROR; } - amf_ue = amf_ue_find_by_id(sess->amf_ue_id); if (!amf_ue) { ogs_error("UE(amf_ue) Context has already been removed"); return OGS_ERROR; } - ran_ue = ran_ue_find_by_id(sess->ran_ue_id); - /* * To check if Reactivation Request has been used. *
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/amf/nsmf-handler.h -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/amf/nsmf-handler.h
Changed
@@ -27,10 +27,13 @@ #include "context.h" int amf_nsmf_pdusession_handle_create_sm_context( - amf_sess_t *sess, ogs_sbi_message_t *recvmsg); + amf_ue_t *amf_ue, ran_ue_t *ran_ue, amf_sess_t *sess, + ogs_sbi_message_t *recvmsg); int amf_nsmf_pdusession_handle_update_sm_context( - amf_sess_t *sess, int state, ogs_sbi_message_t *recvmsg); -int amf_nsmf_pdusession_handle_release_sm_context(amf_sess_t *sess, int state); + amf_ue_t *amf_ue, ran_ue_t *ran_ue, amf_sess_t *sess, + int state, ogs_sbi_message_t *recvmsg); +int amf_nsmf_pdusession_handle_release_sm_context( + amf_ue_t *amf_ue, ran_ue_t *ran_ue, amf_sess_t *sess, int state); #ifdef __cplusplus }
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/amf/sbi-path.c -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/amf/sbi-path.c
Changed
@@ -188,6 +188,9 @@ xact->state = state; + if (ran_ue) + xact->assoc_idAMF_ASSOC_RAN_UE_ID = ran_ue->id; + rv = ogs_sbi_discover_and_send(xact); if (rv != OGS_OK) { ogs_error("amf_sess_sbi_discover_and_send() failed"); @@ -235,6 +238,10 @@ return OGS_ERROR; } + if (xact->assoc_idAMF_ASSOC_RAN_UE_ID >= OGS_MIN_POOL_ID && + xact->assoc_idAMF_ASSOC_RAN_UE_ID <= OGS_MAX_POOL_ID) + ran_ue = ran_ue_find_by_id(xact->assoc_idAMF_ASSOC_RAN_UE_ID); + service_type = xact->service_type; ogs_assert(service_type); target_nf_type = ogs_sbi_service_type_to_nf_type(service_type); @@ -264,7 +271,6 @@ ogs_sbi_response_free(response); return OGS_ERROR; } - ran_ue = ran_ue_find_by_id(sess->ran_ue_id); if (!ran_ue) { ogs_error("%s NG context has already been removed", amf_ue->supi); ogs_sbi_xact_remove(xact); @@ -501,6 +507,9 @@ xact->state = state; + if (ran_ue) + xact->assoc_idAMF_ASSOC_RAN_UE_ID = ran_ue->id; + return ogs_sbi_client_send_request( client, client_discover_cb, xact->request, OGS_UINT_TO_POINTER(xact->id)) == true ? OGS_OK : OGS_ERROR;
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/src/mme/mme-context.c -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/src/mme/mme-context.c
Changed
@@ -5001,8 +5001,10 @@ ogs_assert(list1->taij.type == OGS_TAI1_TYPE); ogs_assert(list1->taij.num <= OGS_MAX_NUM_OF_TAI); - if (list1->taij.tac <= tai->tac && - tai->tac < (list1->taij.tac+list1->taij.num)) + if (memcmp(&list0->taij.plmn_id, + &tai->plmn_id, OGS_PLMN_ID_LEN) == 0 && + list1->taij.tac <= tai->tac && + tai->tac < (list1->taij.tac+list1->taij.num)) return i; }
View file
open5gs_2.7.6.4816.15b1.202511251800.tar.xz/tests/registration/guti-test.c -> open5gs_2.7.6.4819.964b.202511261800.tar.xz/tests/registration/guti-test.c
Changed
@@ -1220,7 +1220,7 @@ test_ue_remove(test_ue); } -static void test4_issues2839_func(abts_case *tc, void *data) +static void test_issues2839_func(abts_case *tc, void *data) { int rv; ogs_socknode_t *ngap; @@ -1517,6 +1517,319 @@ test_ue_remove(test_ue); } +static void test_issues4174_func(abts_case *tc, void *data) +{ + int rv; + ogs_socknode_t *ngap; + ogs_socknode_t *gtpu; + ogs_pkbuf_t *gmmbuf; + ogs_pkbuf_t *gsmbuf; + ogs_pkbuf_t *nasbuf; + ogs_pkbuf_t *sendbuf; + ogs_pkbuf_t *recvbuf; + ogs_ngap_message_t message; + int i; + + ogs_nas_5gs_mobile_identity_suci_t mobile_identity_suci; + test_ue_t *test_ue = NULL; + test_sess_t *sess = NULL; + test_bearer_t *qos_flow = NULL; + + bson_t *doc = NULL; + + /* Setup Test UE & Session Context */ + memset(&mobile_identity_suci, 0, sizeof(mobile_identity_suci)); + + mobile_identity_suci.h.supi_format = OGS_NAS_5GS_SUPI_FORMAT_IMSI; + mobile_identity_suci.h.type = OGS_NAS_5GS_MOBILE_IDENTITY_SUCI; + mobile_identity_suci.routing_indicator1 = 0; + mobile_identity_suci.routing_indicator2 = 0xf; + mobile_identity_suci.routing_indicator3 = 0xf; + mobile_identity_suci.routing_indicator4 = 0xf; + mobile_identity_suci.protection_scheme_id = OGS_PROTECTION_SCHEME_NULL; + mobile_identity_suci.home_network_pki_value = 0; + + test_ue = test_ue_add_by_suci(&mobile_identity_suci, "0000203190"); + ogs_assert(test_ue); + + test_ue->nr_cgi.cell_id = 0x40001; + + test_ue->nas.registration.tsc = 0; + test_ue->nas.registration.ksi = OGS_NAS_KSI_NO_KEY_IS_AVAILABLE; + test_ue->nas.registration.follow_on_request = 1; + test_ue->nas.registration.value = OGS_NAS_5GS_REGISTRATION_TYPE_INITIAL; + + test_ue->k_string = "465b5ce8b199b49faa5f0a2ee238a6bc"; + test_ue->opc_string = "e8ed289deba952e4283b54e88e6183ca"; + + /* gNB connects to AMF */ + ngap = testngap_client(1, AF_INET); + ABTS_PTR_NOTNULL(tc, ngap); + + /* gNB connects to UPF */ + gtpu = test_gtpu_server(1, AF_INET); + ABTS_PTR_NOTNULL(tc, gtpu); + + /* Send NG-Setup Reqeust */ + sendbuf = testngap_build_ng_setup_request(0x4000, 22); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive NG-Setup Response */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /********** Insert Subscriber in Database */ + doc = test_db_new_simple(test_ue); + ABTS_PTR_NOTNULL(tc, doc); + ABTS_INT_EQUAL(tc, OGS_OK, test_db_insert_ue(test_ue, doc)); + + /* Send Registration request */ + test_ue->registration_request_param.guti = 1; + gmmbuf = testgmm_build_registration_request(test_ue, NULL, false, false); + ABTS_PTR_NOTNULL(tc, gmmbuf); + + test_ue->registration_request_param.gmm_capability = 1; + test_ue->registration_request_param.s1_ue_network_capability = 1; + test_ue->registration_request_param.requested_nssai = 1; + test_ue->registration_request_param.last_visited_registered_tai = 1; + test_ue->registration_request_param.ue_usage_setting = 1; + nasbuf = testgmm_build_registration_request(test_ue, NULL, false, false); + ABTS_PTR_NOTNULL(tc, nasbuf); + + sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, + NGAP_RRCEstablishmentCause_mo_Signalling, false, true); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive Identity request */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /* Send Identity response */ + gmmbuf = testgmm_build_identity_response(test_ue); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive Authentication request */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /* Send Authentication response */ + gmmbuf = testgmm_build_authentication_response(test_ue); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive Security mode command */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /* Send Security mode complete */ + gmmbuf = testgmm_build_security_mode_complete(test_ue, nasbuf); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive InitialContextSetupRequest + + * Registration accept */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_InitialContextSetup, + test_ue->ngap_procedure_code); + + /* Send UERadioCapabilityInfoIndication */ + sendbuf = testngap_build_ue_radio_capability_info_indication(test_ue); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Send InitialContextSetupResponse */ + sendbuf = testngap_build_initial_context_setup_response(test_ue, false); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Send Registration complete */ + gmmbuf = testgmm_build_registration_complete(test_ue); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive Configuration update command */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /* Send PDU session establishment request */ + sess = test_sess_add_by_dnn_and_psi(test_ue, "internet", 5); + ogs_assert(sess); + + sess->ul_nas_transport_param.request_type = + OGS_NAS_5GS_REQUEST_TYPE_INITIAL; + sess->ul_nas_transport_param.dnn = 1; + sess->ul_nas_transport_param.s_nssai = 0; + + sess->pdu_session_establishment_param.ssc_mode = 1; + sess->pdu_session_establishment_param.epco = 1; + + gsmbuf = testgsm_build_pdu_session_establishment_request(sess); + ABTS_PTR_NOTNULL(tc, gsmbuf); + gmmbuf = testgmm_build_ul_nas_transport(sess, + OGS_NAS_PAYLOAD_CONTAINER_N1_SM_INFORMATION, gsmbuf); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive PDUSessionResourceSetupRequest + + * DL NAS transport + + * PDU session establishment accept */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_PDUSessionResourceSetup, + test_ue->ngap_procedure_code); + + /* Send PDUSessionResourceSetupResponse */ + sendbuf = testngap_sess_build_pdu_session_resource_setup_response(sess); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + ogs_msleep(100); + + /* Send UEContextReleaseRequest */ + sendbuf = testngap_build_ue_context_release_request(test_ue, + NGAP_Cause_PR_radioNetwork, NGAP_CauseRadioNetwork_user_inactivity, + true); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Send Registration request + * - Update Registration request type + * - Uplink Data Status */ + test_ue->nas.registration.value = + OGS_NAS_5GS_REGISTRATION_TYPE_MOBILITY_UPDATING; + + test_ue->registration_request_param.uplink_data_status = 1; + test_ue->registration_request_param.psimask.uplink_data_status = + 1 << sess->psi; + nasbuf = testgmm_build_registration_request(test_ue, NULL, false, false); + ABTS_PTR_NOTNULL(tc, nasbuf); + + memset(&test_ue->registration_request_param, 0, + sizeof(test_ue->registration_request_param)); + test_ue->registration_request_param.guti = 1; + gmmbuf = testgmm_build_registration_request(test_ue, nasbuf, true, false); + ABTS_PTR_NOTNULL(tc, gmmbuf); + + sendbuf = testngap_build_initial_ue_message(test_ue, gmmbuf, + NGAP_RRCEstablishmentCause_mo_Signalling, true, true); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive UEContextReleaseCommand */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_UEContextRelease, + test_ue->ngap_procedure_code); + + /* Send UEContextReleaseComplete */ + sendbuf = testngap_build_ue_context_release_complete(test_ue); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive InitialContextSetupRequest + + * Registration accept */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_InitialContextSetup, + test_ue->ngap_procedure_code); + ABTS_INT_EQUAL(tc, 0x0000, test_ue->pdu_session_reactivation_result); + + /* Send Registration complete */ + gmmbuf = testgmm_build_registration_complete(test_ue); + ABTS_PTR_NOTNULL(tc, gmmbuf); + sendbuf = testngap_build_uplink_nas_transport(test_ue, gmmbuf); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Send InitialContextSetupResponse */ + sendbuf = testngap_build_initial_context_setup_response(test_ue, true); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive Configuration update command */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + + /* Send UEContextReleaseRequest */ + sendbuf = testngap_build_ue_context_release_request(test_ue, + NGAP_Cause_PR_radioNetwork, NGAP_CauseRadioNetwork_user_inactivity, + true); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + /* Receive UEContextReleaseCommand */ + recvbuf = testgnb_ngap_read(ngap); + ABTS_PTR_NOTNULL(tc, recvbuf); + testngap_recv(test_ue, recvbuf); + ABTS_INT_EQUAL(tc, + NGAP_ProcedureCode_id_UEContextRelease, + test_ue->ngap_procedure_code); + + /* Send UEContextReleaseComplete */ + sendbuf = testngap_build_ue_context_release_complete(test_ue); + ABTS_PTR_NOTNULL(tc, sendbuf); + rv = testgnb_ngap_send(ngap, sendbuf); + ABTS_INT_EQUAL(tc, OGS_OK, rv); + + ogs_msleep(300); + + /********** Remove Subscriber in Database */ + ABTS_INT_EQUAL(tc, OGS_OK, test_db_remove_ue(test_ue)); + + /* gNB disonncect from UPF */ + testgnb_gtpu_close(gtpu); + + /* gNB disonncect from AMF */ + testgnb_ngap_close(ngap); + + /* Clear Test UE Context */ + test_ue_remove(test_ue); +} + #define CONTEXT_TRANSFER_TEST 0 #define OLD_AMF_NOT_FOUND 0 @@ -2006,7 +2319,8 @@ abts_run_test(suite, test1_func, NULL); abts_run_test(suite, test2_func, NULL); abts_run_test(suite, test3_func, NULL); - abts_run_test(suite, test4_issues2839_func, NULL); + abts_run_test(suite, test_issues2839_func, NULL); + abts_run_test(suite, test_issues4174_func, NULL); #else abts_run_test(suite, context_transfer_func, NULL); #endif
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.