Changes of Revision 137

commit_5f9b941d2543d7364c1d7bbf44af0f4dc7668017.txt Deleted
commit_79f73fae2a68495f4e74318fb162b05cd79e5e0c.txt Added
open5gs_2.6.0.8.5f9b.dsc -> open5gs_2.6.0.10.79f73.dsc Changed
x
 
1
@@ -2,7 +2,7 @@
2
 Source: open5gs
3
 Binary: open5gs-common, open5gs-mme, open5gs-sgwc, open5gs-smf, open5gs-amf, open5gs-sgwu, open5gs-upf, open5gs-hss, open5gs-pcrf, open5gs-nrf, open5gs-scp, open5gs-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg
4
 Architecture: any
5
-Version: 2.6.0.8.5f9b
6
+Version: 2.6.0.10.79f73
7
 Maintainer: Harald Welte <laforge@gnumonks.org>
8
 Uploaders: Sukchan Lee <acetcom@gmail.com>
9
 Homepage: https://open5gs.org
10
@@ -31,8 +31,8 @@
11
  open5gs-udr deb net optional arch=any
12
  open5gs-upf deb net optional arch=any
13
 Checksums-Sha1:
14
- 5ba4456271794f84f5257896fa691ee797de8e14 13617004 open5gs_2.6.0.8.5f9b.tar.xz
15
+ bc76658e1d5552a84768f9433ea2bc77d9d99af4 13616644 open5gs_2.6.0.10.79f73.tar.xz
16
 Checksums-Sha256:
17
- 5e516b4b381656180cae13990fe21bc7376f393a2acd7f60bd46fc1d2e49ab63 13617004 open5gs_2.6.0.8.5f9b.tar.xz
18
+ c5bf40462ac800bb800c9281cd0b983a21095e763f9cd648d1e08f175ba68515 13616644 open5gs_2.6.0.10.79f73.tar.xz
19
 Files:
20
- 0babab4709531841a2196ee1d5919eff 13617004 open5gs_2.6.0.8.5f9b.tar.xz
21
+ 28cf2f0b72182d36cc7a7f51f9e702bd 13616644 open5gs_2.6.0.10.79f73.tar.xz
22
open5gs_2.6.0.8.5f9b.tar.xz/.tarball-version -> open5gs_2.6.0.10.79f73.tar.xz/.tarball-version Changed
4
 
1
@@ -1 +1 @@
2
-2.6.0.8-5f9b
3
+2.6.0.10-79f73
4
open5gs_2.6.0.8.5f9b.tar.xz/debian/changelog -> open5gs_2.6.0.10.79f73.tar.xz/debian/changelog Changed
12
 
1
@@ -1,8 +1,8 @@
2
-open5gs (2.6.0.8.5f9b) unstable; urgency=medium
3
+open5gs (2.6.0.10.79f73) unstable; urgency=medium
4
 
5
   * Automatically generated changelog entry for building the Osmocom master feed
6
 
7
- -- Osmocom OBS scripts <info@osmocom.org>  Mon, 30 Jan 2023 16:06:26 +0000
8
+ -- Osmocom OBS scripts <info@osmocom.org>  Sat, 04 Feb 2023 12:05:29 +0000
9
 
10
 open5gs (2.5.6) unstable; urgency=medium
11
 
12
open5gs_2.6.0.8.5f9b.tar.xz/src/amf/context.h -> open5gs_2.6.0.10.79f73.tar.xz/src/amf/context.h Changed
20
 
1
@@ -404,6 +404,8 @@
2
     } handover;
3
 
4
     /* SubscriptionId of Subscription to Data Change Notification to UDM */
5
+#define UDM_SDM_SUBSCRIBED(__aMF) \
6
+    ((__aMF) && ((__aMF)->data_change_subscription_id))
7
     char *data_change_subscription_id;
8
 
9
     struct {
10
@@ -777,6 +779,9 @@
11
 int amf_sess_xact_count(amf_ue_t *amf_ue);
12
 int amf_sess_xact_state_count(amf_ue_t *amf_ue, int state);
13
 
14
+#define AMF_SESSION_RELEASE_PENDING(__aMF) \
15
+    (amf_ue_have_session_release_pending(__aMF) == true)
16
+
17
 #define PDU_RES_SETUP_REQ_TRANSFER_NEEDED(__aMF) \
18
     (amf_pdu_res_setup_req_transfer_needed(__aMF) == true)
19
 bool amf_pdu_res_setup_req_transfer_needed(amf_ue_t *amf_ue);
20
open5gs_2.6.0.8.5f9b.tar.xz/src/amf/gmm-handler.c -> open5gs_2.6.0.10.79f73.tar.xz/src/amf/gmm-handler.c Changed
47
 
1
@@ -646,7 +646,7 @@
2
 int gmm_handle_deregistration_request(amf_ue_t *amf_ue,
3
         ogs_nas_5gs_deregistration_request_from_ue_t *deregistration_request)
4
 {
5
-    int r;
6
+    int r, state, xact_count = 0;
7
     ogs_nas_de_registration_type_t *de_registration_type = NULL;
8
 
9
     ogs_assert(amf_ue);
10
@@ -690,13 +690,30 @@
11
 
12
     ogs_info("%s    SUCI", amf_ue->suci);
13
 
14
-    amf_sbi_send_release_all_sessions(
15
-            amf_ue, AMF_RELEASE_SM_CONTEXT_NO_STATE);
16
+    xact_count = amf_sess_xact_count(amf_ue);
17
 
18
-    if (ogs_list_count(&amf_ue->sess_list) == 0) {
19
-        r = nas_5gs_send_de_registration_accept(amf_ue);
20
-        ogs_expect(r == OGS_OK);
21
-        ogs_assert(r != OGS_ERROR);
22
+    state = AMF_UE_INITIATED_DE_REGISTERED;
23
+    amf_sbi_send_release_all_sessions(amf_ue, state);
24
+
25
+    if (!AMF_SESSION_RELEASE_PENDING(amf_ue) &&
26
+        amf_sess_xact_count(amf_ue) == xact_count) {
27
+        if (UDM_SDM_SUBSCRIBED(amf_ue)) {
28
+            ogs_assert(true == amf_ue_sbi_discover_and_send(
29
+                    OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
30
+                    amf_nudm_sdm_build_subscription_delete,
31
+                    amf_ue, state, NULL));
32
+        } else if (PCF_AM_POLICY_ASSOCIATED(amf_ue)) {
33
+            ogs_assert(true ==
34
+                amf_ue_sbi_discover_and_send(
35
+                    OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL,
36
+                    NULL,
37
+                    amf_npcf_am_policy_control_build_delete,
38
+                    amf_ue, state, NULL));
39
+        } else {
40
+            r = nas_5gs_send_de_registration_accept(amf_ue);
41
+            ogs_expect(r == OGS_OK);
42
+            ogs_assert(r != OGS_ERROR);
43
+        }
44
     }
45
 
46
     return OGS_OK;
47
open5gs_2.6.0.8.5f9b.tar.xz/src/amf/gmm-sm.c -> open5gs_2.6.0.10.79f73.tar.xz/src/amf/gmm-sm.c Changed
201
 
1
@@ -183,6 +183,75 @@
2
             END
3
             break;
4
 
5
+        CASE(OGS_SBI_SERVICE_NAME_NUDM_SDM)
6
+            if ((sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) &&
7
+                (sbi_message->res_status != OGS_SBI_HTTP_STATUS_CREATED) &&
8
+                (sbi_message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT)) {
9
+                ogs_error("%s HTTP response error %d",
10
+                          amf_ue->supi, sbi_message->res_status);
11
+                break;
12
+            }
13
+
14
+            SWITCH(sbi_message->h.resource.component1)
15
+            CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
16
+            CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA)
17
+            CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
18
+                ogs_warn("%s Ignore SBI message", amf_ue->supi);
19
+                break;
20
+
21
+            CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
22
+                SWITCH(sbi_message->h.method)
23
+                CASE(OGS_SBI_HTTP_METHOD_DELETE)
24
+                    /*
25
+                     * - AMF_UE_INITIATED_DE_REGISTERED
26
+                     * 1. PDU session establishment request
27
+                     * 2. PDUSessionResourceSetupRequest +
28
+                     *    PDU session establishment accept
29
+                     * 3. PDUSessionResourceSetupResponse
30
+                     * 4. Deregistration request
31
+                     * 5. UEContextReleaseCommand
32
+                     * 6. UEContextReleaseComplete
33
+                     *
34
+                     * - AMF_RELEASE_SM_CONTEXT_NO_STATE
35
+                     * 1. PDU session release request
36
+                     * 2. PDUSessionResourceReleaseCommand +
37
+                     *    PDU session release command
38
+                     * 3. PDUSessionResourceReleaseREsponse
39
+                     * 4. PDU session release complete
40
+                     * 5. Deregistration request
41
+                     * 6. UEContextReleaseCommand
42
+                     * 7. UEContextReleaseComplete
43
+                     */
44
+                    if (state == AMF_RELEASE_SM_CONTEXT_NO_STATE ||
45
+                        state == AMF_UE_INITIATED_DE_REGISTERED) {
46
+                        if (amf_ue->data_change_subscription_id) {
47
+                            ogs_free(amf_ue->data_change_subscription_id);
48
+                            amf_ue->data_change_subscription_id = NULL;
49
+                        }
50
+
51
+                        ogs_assert(true ==
52
+                            amf_ue_sbi_discover_and_send(
53
+                                OGS_SBI_SERVICE_TYPE_NUDM_UECM, NULL,
54
+                                amf_nudm_uecm_build_registration_delete,
55
+                                amf_ue, state, NULL));
56
+                    } else {
57
+                        ogs_fatal("Invalid state %d", state);
58
+                        ogs_assert_if_reached();
59
+                    }
60
+                    break;
61
+                DEFAULT
62
+                    ogs_warn("%s Ignore invalid HTTP method %s",
63
+                            amf_ue->suci, sbi_message->h.method);
64
+                END
65
+                break;
66
+
67
+            DEFAULT
68
+                ogs_error("Invalid resource name %s",
69
+                        sbi_message->h.resource.component1);
70
+                ogs_assert_if_reached();
71
+            END
72
+            break;
73
+
74
         CASE(OGS_SBI_SERVICE_NAME_NUDM_UECM)
75
             if (sbi_message->res_status != OGS_SBI_HTTP_STATUS_CREATED &&
76
                 sbi_message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT &&
77
@@ -201,31 +270,43 @@
78
                 CASE(OGS_SBI_HTTP_METHOD_PATCH)
79
                     SWITCH(sbi_message->h.resource.component2)
80
                     CASE(OGS_SBI_RESOURCE_NAME_AMF_3GPP_ACCESS)
81
-                       if (amf_ue->data_change_subscription_id) {
82
-                            ogs_free(amf_ue->data_change_subscription_id);
83
-                            amf_ue->data_change_subscription_id = NULL;
84
-                        }
85
-
86
-                        if (state ==
87
-                                AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED ||
88
-                            state ==
89
-                                AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED) {
90
-                            amf_sbi_send_release_all_sessions(amf_ue, state);
91
-                            if ((ogs_list_count(&amf_ue->sess_list) == 0) &&
92
-                                (PCF_AM_POLICY_ASSOCIATED(amf_ue))) {
93
+                        /*
94
+                         * - AMF_UE_INITIATED_DE_REGISTERED
95
+                         * 1. PDU session establishment request
96
+                         * 2. PDUSessionResourceSetupRequest +
97
+                         *    PDU session establishment accept
98
+                         * 3. PDUSessionResourceSetupResponse
99
+                         * 4. Deregistration request
100
+                         * 5. UEContextReleaseCommand
101
+                         * 6. UEContextReleaseComplete
102
+                         *
103
+                         * - AMF_RELEASE_SM_CONTEXT_NO_STATE
104
+                         * 1. PDU session release request
105
+                         * 2. PDUSessionResourceReleaseCommand +
106
+                         *    PDU session release command
107
+                         * 3. PDUSessionResourceReleaseREsponse
108
+                         * 4. PDU session release complete
109
+                         * 5. Deregistration request
110
+                         * 6. UEContextReleaseCommand
111
+                         * 7. UEContextReleaseComplete
112
+                         */
113
+                        if (state == AMF_RELEASE_SM_CONTEXT_NO_STATE ||
114
+                            state == AMF_UE_INITIATED_DE_REGISTERED) {
115
+                            if (PCF_AM_POLICY_ASSOCIATED(amf_ue)) {
116
                                 ogs_assert(true ==
117
                                     amf_ue_sbi_discover_and_send(
118
                                         OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL,
119
                                         NULL,
120
                                         amf_npcf_am_policy_control_build_delete,
121
                                         amf_ue, state, NULL));
122
+                            } else {
123
+                                r = nas_5gs_send_de_registration_accept(amf_ue);
124
+                                ogs_expect(r == OGS_OK);
125
+                                ogs_assert(r != OGS_ERROR);
126
                             }
127
                         } else {
128
-                            ogs_assert(true ==
129
-                                amf_ue_sbi_discover_and_send(
130
-                                    OGS_SBI_SERVICE_TYPE_NAUSF_AUTH, NULL,
131
-                                    amf_nausf_auth_build_authenticate_delete,
132
-                                    amf_ue, state, NULL));
133
+                            ogs_fatal("Invalid state %d", state);
134
+                            ogs_assert_if_reached();
135
                         }
136
                         break;
137
                     DEFAULT
138
@@ -248,44 +329,6 @@
139
             END
140
             break;
141
 
142
-        CASE(OGS_SBI_SERVICE_NAME_NUDM_SDM)
143
-            if ((sbi_message->res_status != OGS_SBI_HTTP_STATUS_OK) &&
144
-                (sbi_message->res_status != OGS_SBI_HTTP_STATUS_CREATED) &&
145
-                (sbi_message->res_status != OGS_SBI_HTTP_STATUS_NO_CONTENT)) {
146
-                ogs_error("%s HTTP response error %d",
147
-                          amf_ue->supi, sbi_message->res_status);
148
-                break;
149
-            }
150
-
151
-            SWITCH(sbi_message->h.resource.component1)
152
-            CASE(OGS_SBI_RESOURCE_NAME_AM_DATA)
153
-            CASE(OGS_SBI_RESOURCE_NAME_SMF_SELECT_DATA)
154
-            CASE(OGS_SBI_RESOURCE_NAME_UE_CONTEXT_IN_SMF_DATA)
155
-                ogs_warn("%s Ignore SBI message", amf_ue->supi);
156
-                break;
157
-
158
-            CASE(OGS_SBI_RESOURCE_NAME_SDM_SUBSCRIPTIONS)
159
-                SWITCH(sbi_message->h.method)
160
-                CASE(OGS_SBI_HTTP_METHOD_DELETE)
161
-                    ogs_assert(true ==
162
-                        amf_ue_sbi_discover_and_send(
163
-                            OGS_SBI_SERVICE_TYPE_NUDM_UECM, NULL,
164
-                            amf_nudm_uecm_build_registration_delete,
165
-                            amf_ue, state, NULL));
166
-                    break;
167
-                DEFAULT
168
-                    ogs_warn("%s Ignore invalid HTTP method %s",
169
-                            amf_ue->suci, sbi_message->h.method);
170
-                END
171
-                break;
172
-
173
-            DEFAULT
174
-                ogs_error("Invalid resource name %s",
175
-                        sbi_message->h.resource.component1);
176
-                ogs_assert_if_reached();
177
-            END
178
-            break;
179
-
180
         CASE(OGS_SBI_SERVICE_NAME_NPCF_AM_POLICY_CONTROL)
181
             SWITCH(sbi_message->h.resource.component0)
182
             CASE(OGS_SBI_RESOURCE_NAME_POLICIES)
183
@@ -295,33 +338,36 @@
184
                     break;
185
 
186
                 CASE(OGS_SBI_HTTP_METHOD_DELETE)
187
-                    if (state == AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED) {
188
-                        ogs_warn("%s Implicit De-registered", amf_ue->supi);
189
-                        OGS_FSM_TRAN(&amf_ue->sm,
190
-                                &gmm_state_ue_context_will_remove);
191
-
192
-                    } else if (state ==
193
-                            AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED) {
194
-                        ogs_warn("%s Explicit De-registered", amf_ue->supi);
195
-
196
-                        amf_ue->explict_de_registered.sbi_done = true;
197
-
198
-                        if (amf_ue->explict_de_registered.n1_done == true) {
199
-                            r = ngap_send_ran_ue_context_release_command(
200
-                                    amf_ue->ran_ue,
201
open5gs_2.6.0.8.5f9b.tar.xz/src/amf/namf-handler.c -> open5gs_2.6.0.10.79f73.tar.xz/src/amf/namf-handler.c Changed
166
 
1
@@ -521,7 +521,7 @@
2
 int amf_namf_callback_handle_dereg_notify(
3
         ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
4
 {
5
-    int r, status = OGS_SBI_HTTP_STATUS_NO_CONTENT;
6
+    int r, state, status = OGS_SBI_HTTP_STATUS_NO_CONTENT;
7
 
8
     amf_ue_t *amf_ue = NULL;
9
 
10
@@ -553,8 +553,14 @@
11
         goto cleanup;
12
     }
13
 
14
-    if (DeregistrationData->access_type != OpenAPI_access_type_3GPP_ACCESS)
15
-    {
16
+    if (DeregistrationData->dereg_reason ==
17
+            OpenAPI_deregistration_reason_NULL) {
18
+        status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
19
+        ogs_error("%s No Deregistraion Reason ", amf_ue->supi);
20
+        goto cleanup;
21
+    }
22
+
23
+    if (DeregistrationData->access_type != OpenAPI_access_type_3GPP_ACCESS) {
24
         status = OGS_SBI_HTTP_STATUS_BAD_REQUEST;
25
         ogs_error("%s Deregistration access type not 3GPP", amf_ue->supi);
26
         goto cleanup;
27
@@ -572,6 +578,21 @@
28
      * Deregistration procedure. In this case, the AMF performs network requested PDU Session Release for any PDU
29
      * session associated with non-emergency service as described in clause 4.3.4.
30
      */
31
+
32
+    /*
33
+     * - AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED
34
+     * 1. UDM_UECM_DeregistrationNotification
35
+     * 2. Deregistration request
36
+     * 3. UDM_SDM_Unsubscribe
37
+     * 4. UDM_UECM_Deregisration
38
+     * 5. PDU session release request
39
+     * 6. PDUSessionResourceReleaseCommand +
40
+     *    PDU session release command
41
+     * 7. PDUSessionResourceReleaseResponse
42
+     * 8. AM_Policy_Association_Termination
43
+     * 9.  Deregistration accept
44
+     * 10. Signalling Connecion Release
45
+     */
46
     if (CM_CONNECTED(amf_ue)) {
47
         r = nas_5gs_send_de_registration_request(
48
                 amf_ue,
49
@@ -580,24 +601,32 @@
50
         ogs_expect(r == OGS_OK);
51
         ogs_assert(r != OGS_ERROR);
52
 
53
-        ogs_assert(true == amf_ue_sbi_discover_and_send(
54
-                OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
55
-                amf_nudm_sdm_build_subscription_delete,
56
-                amf_ue,
57
-                AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED, NULL));
58
+        state = AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED;
59
+
60
     } else if (CM_IDLE(amf_ue)) {
61
         ogs_error("Not implemented : Use Implicit De-registration");
62
 
63
-        ogs_assert(true == amf_ue_sbi_discover_and_send(
64
-                OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
65
-                amf_nudm_sdm_build_subscription_delete,
66
-                amf_ue,
67
-                AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED, NULL));
68
+        state = AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED;
69
+
70
     } else {
71
         ogs_fatal("Invalid State");
72
         ogs_assert_if_reached();
73
     }
74
 
75
+    if (UDM_SDM_SUBSCRIBED(amf_ue)) {
76
+        ogs_assert(true == amf_ue_sbi_discover_and_send(
77
+                OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
78
+                amf_nudm_sdm_build_subscription_delete,
79
+                amf_ue, state, NULL));
80
+    } else if (PCF_AM_POLICY_ASSOCIATED(amf_ue)) {
81
+        ogs_assert(true ==
82
+            amf_ue_sbi_discover_and_send(
83
+                OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL,
84
+                NULL,
85
+                amf_npcf_am_policy_control_build_delete,
86
+                amf_ue, state, NULL));
87
+    }
88
+
89
 cleanup:
90
     memset(&sendmsg, 0, sizeof(sendmsg));
91
 
92
@@ -799,8 +828,7 @@
93
 int amf_namf_callback_handle_sdm_data_change_notify(
94
         ogs_sbi_stream_t *stream, ogs_sbi_message_t *recvmsg)
95
 {
96
-    int status = OGS_SBI_HTTP_STATUS_NO_CONTENT;
97
-    int r;
98
+    int r, state, status = OGS_SBI_HTTP_STATUS_NO_CONTENT;
99
 
100
     amf_ue_t *amf_ue = NULL;
101
 
102
@@ -880,6 +908,20 @@
103
     }
104
 
105
     if (amf_ue_is_rat_restricted(amf_ue)) {
106
+        /*
107
+         * - AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED
108
+         * 1. UDM_UECM_DeregistrationNotification
109
+         * 2. Deregistration request
110
+         * 3. UDM_SDM_Unsubscribe
111
+         * 4. UDM_UECM_Deregisration
112
+         * 5. PDU session release request
113
+         * 6. PDUSessionResourceReleaseCommand +
114
+         *    PDU session release command
115
+         * 7. PDUSessionResourceReleaseResponse
116
+         * 8. AM_Policy_Association_Termination
117
+         * 9.  Deregistration accept
118
+         * 10. Signalling Connecion Release
119
+         */
120
         if (CM_CONNECTED(amf_ue)) {
121
             r = nas_5gs_send_de_registration_request(
122
                     amf_ue,
123
@@ -887,24 +929,32 @@
124
             ogs_expect(r == OGS_OK);
125
             ogs_assert(r != OGS_ERROR);
126
 
127
-            ogs_assert(true == amf_ue_sbi_discover_and_send(
128
-                    OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
129
-                    amf_nudm_sdm_build_subscription_delete,
130
-                    amf_ue,
131
-                    AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED, NULL));
132
+            state = AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED;
133
+
134
         } else if (CM_IDLE(amf_ue)) {
135
             ogs_error("Not implemented : Use Implicit De-registration");
136
 
137
-            ogs_assert(true == amf_ue_sbi_discover_and_send(
138
-                    OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
139
-                    amf_nudm_sdm_build_subscription_delete,
140
-                    amf_ue,
141
-                    AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED, NULL));
142
+            state = AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED;
143
+
144
         } else {
145
             ogs_fatal("Invalid State");
146
             ogs_assert_if_reached();
147
         }
148
 
149
+        if (UDM_SDM_SUBSCRIBED(amf_ue)) {
150
+            ogs_assert(true == amf_ue_sbi_discover_and_send(
151
+                    OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
152
+                    amf_nudm_sdm_build_subscription_delete,
153
+                    amf_ue, state, NULL));
154
+        } else if (PCF_AM_POLICY_ASSOCIATED(amf_ue)) {
155
+            ogs_assert(true ==
156
+                amf_ue_sbi_discover_and_send(
157
+                    OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL,
158
+                    NULL,
159
+                    amf_npcf_am_policy_control_build_delete,
160
+                    amf_ue, state, NULL));
161
+        }
162
+
163
     } else if (ambr_changed) {
164
         ogs_pkbuf_t *ngapbuf;
165
 
166
open5gs_2.6.0.8.5f9b.tar.xz/src/amf/nsmf-handler.c -> open5gs_2.6.0.10.79f73.tar.xz/src/amf/nsmf-handler.c Changed
191
 
1
@@ -910,21 +910,110 @@
2
                 /* Not reached here */
3
                 ogs_assert_if_reached();
4
 
5
-            } else if (state == AMF_RELEASE_SM_CONTEXT_NO_STATE ||
6
-                        state == AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED ||
7
-                        state == AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED) {
8
-                /* NO_STATE */
9
+            } else if (state == AMF_UE_INITIATED_DE_REGISTERED) {
10
 
11
-                if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_authentication)) {
12
+                if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_de_registered)) {
13
+                    /*
14
+                     * 1. PDU session establishment request
15
+                     * 2. PDUSessionResourceSetupRequest +
16
+                     *    PDU session establishment accept
17
+                     * 3. PDUSessionResourceSetupResponse
18
+                     * 4. Deregistration request
19
+                     * 5. UEContextReleaseCommand
20
+                     * 6. UEContextReleaseComplete
21
+                     */
22
+                    if (UDM_SDM_SUBSCRIBED(amf_ue)) {
23
+                        ogs_assert(true == amf_ue_sbi_discover_and_send(
24
+                                OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
25
+                                amf_nudm_sdm_build_subscription_delete,
26
+                                amf_ue, state, NULL));
27
+                    } else if (PCF_AM_POLICY_ASSOCIATED(amf_ue)) {
28
+                        ogs_assert(true ==
29
+                            amf_ue_sbi_discover_and_send(
30
+                                OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL,
31
+                                NULL,
32
+                                amf_npcf_am_policy_control_build_delete,
33
+                                amf_ue, state, NULL));
34
+                    } else {
35
+                        r = nas_5gs_send_de_registration_accept(amf_ue);
36
+                        ogs_expect(r == OGS_OK);
37
+                        ogs_assert(r != OGS_ERROR);
38
+                    }
39
 
40
-                    ogs_assert(true ==
41
-                        amf_ue_sbi_discover_and_send(
42
-                            OGS_SBI_SERVICE_TYPE_NAUSF_AUTH, NULL,
43
-                            amf_nausf_auth_build_authenticate,
44
-                            amf_ue, 0, NULL));
45
+                } else if (OGS_FSM_CHECK(&amf_ue->sm,
46
+                            gmm_state_authentication)) {
47
+                    ogs_fatal("Release SM Context in authentication");
48
+                    ogs_assert_if_reached();
49
+                } else if (OGS_FSM_CHECK(
50
+                            &amf_ue->sm, gmm_state_security_mode)) {
51
+                    ogs_fatal("Release SM Context in security-mode");
52
+                    ogs_assert_if_reached();
53
+                } else if (OGS_FSM_CHECK(&amf_ue->sm,
54
+                                gmm_state_initial_context_setup)) {
55
+                    ogs_fatal("Release SM Context in initial-context-setup");
56
+                    ogs_assert_if_reached();
57
+                } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_registered)) {
58
+                    ogs_fatal("Release SM Context in registered");
59
+                    ogs_assert_if_reached();
60
+                } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_exception)) {
61
+                    ogs_fatal("Release SM Context in exception");
62
+                    ogs_assert_if_reached();
63
+                } else {
64
+                    ogs_fatal("Release SM Context : INVALID STATE");
65
+                    ogs_assert_if_reached();
66
+                }
67
+
68
+            } else if (state == AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED ||
69
+                        state == AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED) {
70
 
71
+                if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_de_registered)) {
72
+                    ogs_fatal("Release SM Context in de-registered");
73
+                    ogs_assert_if_reached();
74
                 } else if (OGS_FSM_CHECK(&amf_ue->sm,
75
-                            gmm_state_de_registered)) {
76
+                            gmm_state_authentication)) {
77
+                    ogs_fatal("Release SM Context in authentication");
78
+                    ogs_assert_if_reached();
79
+                } else if (OGS_FSM_CHECK(
80
+                            &amf_ue->sm, gmm_state_security_mode)) {
81
+                    ogs_fatal("Release SM Context in security-mode");
82
+                    ogs_assert_if_reached();
83
+                } else if (OGS_FSM_CHECK(&amf_ue->sm,
84
+                                gmm_state_initial_context_setup)) {
85
+                    ogs_fatal("Release SM Context in initial-context-setup");
86
+                    ogs_assert_if_reached();
87
+                } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_registered)) {
88
+                    /*
89
+                     * 1. Network-Initiated Implict-Explicit De-Registered
90
+                     * 5. Deregistration request
91
+                     * 5. Deregistration accept
92
+                     * 6. UEContextReleaseCommand
93
+                     * 7. UEContextReleaseComplete
94
+                     */
95
+                    if (UDM_SDM_SUBSCRIBED(amf_ue)) {
96
+                        ogs_assert(true == amf_ue_sbi_discover_and_send(
97
+                                OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
98
+                                amf_nudm_sdm_build_subscription_delete,
99
+                                amf_ue, state, NULL));
100
+                    } else if (PCF_AM_POLICY_ASSOCIATED(amf_ue)) {
101
+                        ogs_assert(true ==
102
+                            amf_ue_sbi_discover_and_send(
103
+                                OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL,
104
+                                NULL,
105
+                                amf_npcf_am_policy_control_build_delete,
106
+                                amf_ue, state, NULL));
107
+                    }
108
+
109
+                } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_exception)) {
110
+                    ogs_fatal("Release SM Context in exception");
111
+                    ogs_assert_if_reached();
112
+                } else {
113
+                    ogs_fatal("Release SM Context : INVALID STATE");
114
+                    ogs_assert_if_reached();
115
+                }
116
+            } else if (state == AMF_RELEASE_SM_CONTEXT_NO_STATE) {
117
+                /* NO_STATE */
118
+
119
+                if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_de_registered)) {
120
                     /*
121
                      * 1. PDU session release request
122
                      * 2. PDUSessionResourceReleaseCommand +
123
@@ -935,13 +1024,40 @@
124
                      * 6. UEContextReleaseCommand
125
                      * 7. UEContextReleaseComplete
126
                      */
127
+                    if (UDM_SDM_SUBSCRIBED(amf_ue)) {
128
+                        ogs_assert(true == amf_ue_sbi_discover_and_send(
129
+                                OGS_SBI_SERVICE_TYPE_NUDM_SDM, NULL,
130
+                                amf_nudm_sdm_build_subscription_delete,
131
+                                amf_ue, state, NULL));
132
+                    } else if (PCF_AM_POLICY_ASSOCIATED(amf_ue)) {
133
+                        ogs_assert(true ==
134
+                            amf_ue_sbi_discover_and_send(
135
+                                OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL,
136
+                                NULL,
137
+                                amf_npcf_am_policy_control_build_delete,
138
+                                amf_ue, state, NULL));
139
+                    } else {
140
+                        r = nas_5gs_send_de_registration_accept(amf_ue);
141
+                        ogs_expect(r == OGS_OK);
142
+                        ogs_assert(r != OGS_ERROR);
143
+                    }
144
+                } else if (OGS_FSM_CHECK(&amf_ue->sm,
145
+                            gmm_state_authentication)) {
146
 
147
                     ogs_assert(true ==
148
                         amf_ue_sbi_discover_and_send(
149
-                            OGS_SBI_SERVICE_TYPE_NPCF_AM_POLICY_CONTROL, NULL,
150
-                            amf_npcf_am_policy_control_build_delete,
151
-                            amf_ue, state, NULL));
152
+                            OGS_SBI_SERVICE_TYPE_NAUSF_AUTH, NULL,
153
+                            amf_nausf_auth_build_authenticate,
154
+                            amf_ue, 0, NULL));
155
 
156
+                } else if (OGS_FSM_CHECK(
157
+                            &amf_ue->sm, gmm_state_security_mode)) {
158
+                    ogs_fatal("Release SM Context in security-mode");
159
+                    ogs_assert_if_reached();
160
+                } else if (OGS_FSM_CHECK(&amf_ue->sm,
161
+                                gmm_state_initial_context_setup)) {
162
+                    ogs_fatal("Release SM Context in initial-context-setup");
163
+                    ogs_assert_if_reached();
164
                 } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_registered)) {
165
                     /*
166
                      * 1. PDU session release request
167
@@ -950,8 +1066,6 @@
168
                      * 3. PDUSessionResourceReleaseREsponse
169
                      * 4. PDU session release complete
170
                      *
171
-                     * No Deregistration request in the above step
172
-                     *
173
                      * So, Nothing to do!
174
                      */
175
                 } else if (OGS_FSM_CHECK(&amf_ue->sm, gmm_state_exception)) {
176
@@ -967,14 +1081,6 @@
177
                     ogs_expect(r == OGS_OK);
178
                     ogs_assert(r != OGS_ERROR);
179
 
180
-                } else if (OGS_FSM_CHECK(&amf_ue->sm,
181
-                                gmm_state_initial_context_setup)) {
182
-                    ogs_fatal("Release SM Context in initial-context-setup");
183
-                    ogs_assert_if_reached();
184
-                } else if (OGS_FSM_CHECK(
185
-                            &amf_ue->sm, gmm_state_security_mode)) {
186
-                    ogs_fatal("Release SM Context in security-mode");
187
-                    ogs_assert_if_reached();
188
                 } else {
189
                     ogs_fatal("Release SM Context : INVALID STATE");
190
                     ogs_assert_if_reached();
191
open5gs_2.6.0.8.5f9b.tar.xz/src/amf/sbi-path.c -> open5gs_2.6.0.10.79f73.tar.xz/src/amf/sbi-path.c Changed
42
 
1
@@ -495,3 +495,40 @@
2
 
3
     return rc;
4
 }
5
+
6
+bool amf_ue_have_session_release_pending(amf_ue_t *amf_ue)
7
+{
8
+    amf_sess_t *sess = NULL;
9
+
10
+    ogs_assert(amf_ue);
11
+
12
+    ogs_list_for_each(&amf_ue->sess_list, sess) {
13
+        if (amf_sess_have_session_release_pending(sess) == true)
14
+            return true;
15
+    }
16
+
17
+    return false;
18
+}
19
+
20
+bool amf_sess_have_session_release_pending(amf_sess_t *sess)
21
+{
22
+    ogs_sbi_xact_t *xact = NULL;
23
+
24
+    ogs_assert(sess);
25
+
26
+    ogs_list_for_each(&sess->sbi.xact_list, xact) {
27
+        if (xact->state == AMF_UPDATE_SM_CONTEXT_N1_RELEASED)
28
+            return true;
29
+        if (xact->state == AMF_UPDATE_SM_CONTEXT_N2_RELEASED)
30
+            return true;
31
+    }
32
+
33
+    if (sess->n1_released == true)
34
+        return true;
35
+    if (sess->n2_released == true)
36
+        return true;
37
+    if (sess->resource_status == OpenAPI_resource_status_RELEASED)
38
+        return true;
39
+
40
+    return false;
41
+}
42
open5gs_2.6.0.8.5f9b.tar.xz/src/amf/sbi-path.h -> open5gs_2.6.0.10.79f73.tar.xz/src/amf/sbi-path.h Changed
23
 
1
@@ -39,8 +39,9 @@
2
 
3
 #define AMF_CREATE_SM_CONTEXT_NO_STATE                  0
4
 
5
-#define AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED    1
6
-#define AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED    2
7
+#define AMF_UE_INITIATED_DE_REGISTERED                  1
8
+#define AMF_NETWORK_INITIATED_IMPLICIT_DE_REGISTERED    2
9
+#define AMF_NETWORK_INITIATED_EXPLICIT_DE_REGISTERED    3
10
 
11
 #define AMF_UPDATE_SM_CONTEXT_ACTIVATED                 11
12
 #define AMF_UPDATE_SM_CONTEXT_SETUP_FAIL                12
13
@@ -94,6 +95,9 @@
14
 bool amf_sbi_send_n1_n2_failure_notify(
15
         amf_sess_t *sess, OpenAPI_n1_n2_message_transfer_cause_e cause);
16
 
17
+bool amf_ue_have_session_release_pending(amf_ue_t *amf_ue);
18
+bool amf_sess_have_session_release_pending(amf_sess_t *sess);
19
+
20
 #ifdef __cplusplus
21
 }
22
 #endif
23
open5gs_2.6.0.8.5f9b.tar.xz/src/smf/gx-path.c -> open5gs_2.6.0.10.79f73.tar.xz/src/smf/gx-path.c Changed
10
 
1
@@ -28,7 +28,7 @@
2
 
3
     os0_t       peer_host;          /* Peer Host */
4
 
5
-#define MAX_CC_REQUEST_NUMBER 32
6
+#define MAX_CC_REQUEST_NUMBER 64
7
     smf_sess_t *sess;
8
     ogs_gtp_xact_t *xactMAX_CC_REQUEST_NUMBER;
9
 
10
open5gs_2.6.0.8.5f9b.tar.xz/src/smf/gy-path.c -> open5gs_2.6.0.10.79f73.tar.xz/src/smf/gy-path.c Changed
10
 
1
@@ -29,7 +29,7 @@
2
 
3
     os0_t       peer_host;          /* Peer Host */
4
 
5
-#define MAX_CC_REQUEST_NUMBER 32
6
+#define MAX_CC_REQUEST_NUMBER 64
7
     smf_sess_t *sess;
8
     struct {
9
         bool pfcp;
10