Projects
osmocom:nightly
open5gs
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 3
View file
open5gs_2.4.8.202206271119.dsc -> open5gs_2.4.8.202206281008.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-ausf, open5gs-udm, open5gs-pcf, open5gs-nssf, open5gs-bsf, open5gs-udr, open5gs, open5gs-dbg Architecture: any -Version: 2.4.8.202206271119 +Version: 2.4.8.202206281008 Maintainer: Harald Welte <laforge@gnumonks.org> Uploaders: Sukchan Lee <acetcom@gmail.com> Homepage: https://open5gs.org @@ -30,8 +30,8 @@ open5gs-udr deb net optional arch=any open5gs-upf deb net optional arch=any Checksums-Sha1: - b33b28597d7a680df1213da2b9ad805967b690bd 11442952 open5gs_2.4.8.202206271119.tar.xz + 7c8afd01b73ce39a3f9537177165d9ee1c7841e3 11443376 open5gs_2.4.8.202206281008.tar.xz Checksums-Sha256: - d06a4332e9f017c82cf3c32ea975af83f2d69b1cb292db2982f8053b1003b9f6 11442952 open5gs_2.4.8.202206271119.tar.xz + 341be8271c61702bc4de9387c6f5cba745f999149a94a0525b41a7100f681472 11443376 open5gs_2.4.8.202206281008.tar.xz Files: - 66429e904664ee2e43f0eed434d13758 11442952 open5gs_2.4.8.202206271119.tar.xz + dca61de6c6298fe583dcb1f648909dd1 11443376 open5gs_2.4.8.202206281008.tar.xz
View file
open5gs_2.4.8.202206271119.tar.xz/debian/changelog -> open5gs_2.4.8.202206281008.tar.xz/debian/changelog
Changed
@@ -1,8 +1,8 @@ -open5gs (2.4.8.202206271119) UNRELEASED; urgency=medium +open5gs (2.4.8.202206281008) UNRELEASED; urgency=medium * Snapshot build - -- Sukchan Lee <acetcom@gmail.com> Mon, 27 Jun 2022 11:26:00 +0000 + -- Sukchan Lee <acetcom@gmail.com> Tue, 28 Jun 2022 10:15:17 +0000 open5gs (2.4.8) unstable; urgency=medium
View file
open5gs_2.4.8.202206271119.tar.xz/debian/control -> open5gs_2.4.8.202206281008.tar.xz/debian/control
Changed
@@ -31,7 +31,7 @@ Package: open5gs-common Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends} Description: 5G Core and EPC (Shared Files) Open5GS is a C-language implementation of 5G Core and EPC @@ -43,7 +43,7 @@ Package: open5gs-mme Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: MME (Mobility Management Entity) @@ -58,7 +58,7 @@ Package: open5gs-sgwc Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: SGW-C (Serving Gateway - Control Plane) @@ -72,7 +72,7 @@ Package: open5gs-smf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: SMF (Session Management Function) @@ -84,7 +84,7 @@ Package: open5gs-amf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: AMF (Access and Mobility Management Function) @@ -96,7 +96,7 @@ Package: open5gs-sgwu Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: SGW-U (Serving Gateway - User Plane) @@ -110,7 +110,7 @@ Package: open5gs-upf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, udev, open5gs-common (= ${binary:Version}) @@ -123,7 +123,7 @@ Package: open5gs-hss Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, mongodb-org | mongodb, open5gs-common (= ${binary:Version}) @@ -140,7 +140,7 @@ Package: open5gs-pcrf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, mongodb-org | mongodb, open5gs-common (= ${binary:Version}) @@ -156,7 +156,7 @@ Package: open5gs-nrf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: NRF (Network Repository Function) @@ -168,7 +168,7 @@ Package: open5gs-ausf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: AUSF (Authentication Server Function) @@ -180,7 +180,7 @@ Package: open5gs-udm Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: UDM (Unified Data Management) @@ -192,7 +192,7 @@ Package: open5gs-pcf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: PCF (Policy Control Function) @@ -204,7 +204,7 @@ Package: open5gs-nssf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: NSSF (Network Slice Selection Function) @@ -216,7 +216,7 @@ Package: open5gs-bsf Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: BSF (Binding Support Function) @@ -228,7 +228,7 @@ Package: open5gs-udr Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${shlibs:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${shlibs:Depends}, ${misc:Depends}, open5gs-common (= ${binary:Version}) Description: UDR (Unified Data Repository) @@ -240,7 +240,7 @@ Package: open5gs Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${misc:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${misc:Depends}, open5gs-common (= ${binary:Version}), open5gs-mme (= ${binary:Version}), open5gs-sgwc (= ${binary:Version}), @@ -266,7 +266,7 @@ Package: open5gs-dbg Architecture: any Multi-Arch: same -Depends: osmocom-nightly (= 1.0.0.202206271119), ${misc:Depends}, +Depends: osmocom-nightly (= 1.0.0.202206281008), ${misc:Depends}, open5gs (= ${binary:Version}) Description: Debug symbols for Open5GS Open5GS is a C-language implementation of 5G Core and EPC
View file
open5gs_2.4.8.202206271119.tar.xz/lib/gtp/v1/types.h -> open5gs_2.4.8.202206281008.tar.xz/lib/gtp/v1/types.h
Changed
@@ -277,6 +277,18 @@ #define OGS_GTP1_QOS_SRC_STATS_DESC_UNKNOWN 0 #define OGS_GTP1_QOS_SRC_STATS_DESC_SPEECH 1 +/* 7.7.48 Common Flags */ +typedef struct ogs_gtp1_common_flags_s { +ED8(uint8_t dual_address_bearer_flag:1;, + uint8_t upgrade_qos_supported:1;, + uint8_t nrsn:1;, + uint8_t no_qos_negotiation:1;, + uint8_t mbms_counting_information:1;, + uint8_t ran_procedures_ready:1;, + uint8_t mbms_service_type:1;, + uint8_t prohibit_payload_compression:1;) +} __attribute__ ((packed)) ogs_gtp1_common_flags_t; + /* 7.7.98 APN Aggregate Maximum Bit Rate (APN-AMBR) */ typedef struct ogs_gtp1_apn_ambr_s { uint32_t uplink;
View file
open5gs_2.4.8.202206271119.tar.xz/lib/gtp/xact.h -> open5gs_2.4.8.202206281008.tar.xz/lib/gtp/xact.h
Changed
@@ -86,6 +86,9 @@ ogs_timer_t *tm_holding; /**< Timer waiting for holding message */ uint8_t holding_rcount; + uint32_t local_teid; /**< Local TEID, + expected in reply from peer */ + void *assoc_xact; /**< Associated GTP transaction */ void *pfcp_xact; /**< Associated PFCP transaction */
View file
open5gs_2.4.8.202206271119.tar.xz/lib/pfcp/xact.h -> open5gs_2.4.8.202206281008.tar.xz/lib/pfcp/xact.h
Changed
@@ -65,6 +65,9 @@ ogs_timer_t *tm_delayed_commit; /**< Timer waiting for commit xact */ + uint64_t local_seid; /**< Local SEID, + expected in reply from peer */ + void *assoc_xact; /**< Associated GTP transaction */ ogs_pkbuf_t *gtpbuf; /**< GTP packet buffer */
View file
open5gs_2.4.8.202206271119.tar.xz/src/amf/ngap-sctp.c -> open5gs_2.4.8.202206281008.tar.xz/src/amf/ngap-sctp.c
Changed
@@ -238,8 +238,14 @@ ngap_event_push(AMF_EVT_NGAP_MESSAGE, sock, addr, pkbuf, 0, 0); return; } else { - ogs_fatal("Invalid flag(0x%x)", flags); - ogs_assert_if_reached(); + if (ogs_socket_errno != OGS_EAGAIN) { + ogs_fatal("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)", + size, errno, strerror(errno), flags); + ogs_assert_if_reached(); + } else { + ogs_error("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)", + size, errno, strerror(errno), flags); + } } ogs_pkbuf_free(pkbuf);
View file
open5gs_2.4.8.202206271119.tar.xz/src/mme/mme-gtp-path.c -> open5gs_2.4.8.202206281008.tar.xz/src/mme/mme-gtp-path.c
Changed
@@ -228,6 +228,7 @@ xact = ogs_gtp_xact_local_create(sgw_ue->gnode, &h, pkbuf, timeout, sess); ogs_expect_or_return_val(xact, OGS_ERROR); xact->create_action = create_action; + xact->local_teid = mme_ue->mme_s11_teid; rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK); @@ -260,6 +261,7 @@ xact = ogs_gtp_xact_local_create(sgw_ue->gnode, &h, pkbuf, timeout, mme_ue); ogs_expect_or_return_val(xact, OGS_ERROR); xact->modify_action = modify_action; + xact->local_teid = mme_ue->mme_s11_teid; rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK); @@ -292,6 +294,7 @@ xact = ogs_gtp_xact_local_create(sgw_ue->gnode, &h, s11buf, timeout, sess); ogs_expect_or_return_val(xact, OGS_ERROR); xact->delete_action = action; + xact->local_teid = mme_ue->mme_s11_teid; rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK); @@ -470,6 +473,7 @@ xact = ogs_gtp_xact_local_create(sgw_ue->gnode, &h, pkbuf, timeout, mme_ue); ogs_expect_or_return_val(xact, OGS_ERROR); xact->release_action = action; + xact->local_teid = mme_ue->mme_s11_teid; rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK); @@ -586,6 +590,7 @@ xact = ogs_gtp_xact_local_create(sgw_ue->gnode, &h, pkbuf, timeout, mme_ue); ogs_expect_or_return_val(xact, OGS_ERROR); + xact->local_teid = mme_ue->mme_s11_teid; rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK); @@ -618,6 +623,7 @@ xact = ogs_gtp_xact_local_create(sgw_ue->gnode, &h, pkbuf, timeout, mme_ue); ogs_expect_or_return_val(xact, OGS_ERROR); xact->delete_indirect_action = action; + xact->local_teid = mme_ue->mme_s11_teid; rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK); @@ -652,6 +658,7 @@ xact = ogs_gtp_xact_local_create(sgw_ue->gnode, &h, pkbuf, timeout, bearer); ogs_expect_or_return_val(xact, OGS_ERROR); xact->xid |= OGS_GTP_CMD_XACT_ID; + xact->local_teid = mme_ue->mme_s11_teid; rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK);
View file
open5gs_2.4.8.202206271119.tar.xz/src/mme/mme-s11-handler.c -> open5gs_2.4.8.202206281008.tar.xz/src/mme/mme-s11-handler.c
Changed
@@ -78,7 +78,7 @@ } void mme_s11_handle_create_session_response( - ogs_gtp_xact_t *xact, mme_ue_t *mme_ue_from_teid, + ogs_gtp_xact_t *xact, mme_ue_t *mme_ue, ogs_gtp2_create_session_response_t *rsp) { int rv, i; @@ -91,7 +91,6 @@ mme_bearer_t *bearer = NULL; mme_sess_t *sess = NULL; - mme_ue_t *mme_ue = NULL; sgw_ue_t *source_ue = NULL, *target_ue = NULL; ogs_session_t *session = NULL; ogs_gtp2_bearer_qos_t bearer_qos; @@ -99,6 +98,7 @@ uint16_t decoded = 0; int create_action = 0; + ogs_assert(mme_ue); ogs_assert(rsp); ogs_debug("Create Session Response"); @@ -110,8 +110,6 @@ create_action = xact->create_action; sess = xact->data; ogs_assert(sess); - mme_ue = sess->mme_ue; - ogs_assert(mme_ue); source_ue = sgw_ue_cycle(mme_ue->sgw_ue); ogs_assert(source_ue); @@ -131,11 +129,6 @@ ************************/ cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - if (!mme_ue_from_teid) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { if (create_action == OGS_GTP_CREATE_IN_ATTACH_REQUEST) { ogs_error("%s Attach reject", mme_ue->imsi_bcd); @@ -400,7 +393,7 @@ } void mme_s11_handle_modify_bearer_response( - ogs_gtp_xact_t *xact, mme_ue_t *mme_ue_from_teid, + ogs_gtp_xact_t *xact, mme_ue_t *mme_ue, ogs_gtp2_modify_bearer_response_t *rsp) { int rv; @@ -408,9 +401,9 @@ int modify_action = 0; ogs_gtp2_cause_t *cause = NULL; - mme_ue_t *mme_ue = NULL; sgw_ue_t *sgw_ue = NULL; + ogs_assert(mme_ue); ogs_assert(rsp); ogs_debug("Modify Bearer Response"); @@ -420,8 +413,6 @@ ********************/ ogs_assert(xact); modify_action = xact->modify_action; - mme_ue = xact->data; - ogs_assert(mme_ue); sgw_ue = sgw_ue_cycle(mme_ue->sgw_ue); ogs_assert(sgw_ue); @@ -433,11 +424,6 @@ ************************/ cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - if (!mme_ue_from_teid) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { mme_send_delete_session_or_mme_ue_context_release(mme_ue); return; @@ -494,7 +480,7 @@ } void mme_s11_handle_delete_session_response( - ogs_gtp_xact_t *xact, mme_ue_t *mme_ue_from_teid, + ogs_gtp_xact_t *xact, mme_ue_t *mme_ue, ogs_gtp2_delete_session_response_t *rsp) { int rv; @@ -502,8 +488,8 @@ int action = 0; sgw_ue_t *source_ue = NULL, *target_ue = NULL; mme_sess_t *sess = NULL; - mme_ue_t *mme_ue = NULL; + ogs_assert(mme_ue); ogs_assert(rsp); ogs_debug("Delete Session Response"); @@ -516,8 +502,6 @@ ogs_assert(action); sess = xact->data; ogs_assert(sess); - mme_ue = sess->mme_ue; - ogs_assert(mme_ue); target_ue = sgw_ue_cycle(mme_ue->sgw_ue); ogs_assert(target_ue); @@ -532,13 +516,6 @@ rv = ogs_gtp_xact_commit(xact); ogs_expect_or_return(rv == OGS_OK); - /************************ - * Check MME-UE Context - ************************/ - if (!mme_ue_from_teid) { - ogs_error("No Context in TEID"); - } - /******************** * Check Cause Value ********************/ @@ -1076,7 +1053,7 @@ } void mme_s11_handle_release_access_bearers_response( - ogs_gtp_xact_t *xact, mme_ue_t *mme_ue_from_teid, + ogs_gtp_xact_t *xact, mme_ue_t *mme_ue, ogs_gtp2_release_access_bearers_response_t *rsp) { int rv; @@ -1085,10 +1062,10 @@ enb_ue_t *enb_ue = NULL; sgw_ue_t *sgw_ue = NULL;; - mme_ue_t *mme_ue = NULL; mme_sess_t *sess = NULL; mme_bearer_t *bearer = NULL; + ogs_assert(mme_ue); ogs_assert(rsp); ogs_debug("Release Access Bearers Response"); @@ -1099,21 +1076,12 @@ ogs_assert(xact); action = xact->release_action; ogs_assert(action); - mme_ue = xact->data; - ogs_assert(mme_ue); sgw_ue = sgw_ue_cycle(mme_ue->sgw_ue); ogs_assert(sgw_ue); rv = ogs_gtp_xact_commit(xact); ogs_expect_or_return(rv == OGS_OK); - /*********************** - * Check MME-UE Context - ***********************/ - if (!mme_ue_from_teid) { - ogs_error("No Context in TEID"); - } - /******************** * Check Cause Value ********************/ @@ -1365,7 +1333,7 @@ } void mme_s11_handle_create_indirect_data_forwarding_tunnel_response( - ogs_gtp_xact_t *xact, mme_ue_t *mme_ue_from_teid, + ogs_gtp_xact_t *xact, mme_ue_t *mme_ue, ogs_gtp2_create_indirect_data_forwarding_tunnel_response_t *rsp) { int rv; @@ -1373,12 +1341,12 @@ ogs_gtp2_cause_t *cause = NULL; sgw_ue_t *sgw_ue = NULL; mme_bearer_t *bearer = NULL; - mme_ue_t *mme_ue = NULL; enb_ue_t *source_ue = NULL; int i; ogs_gtp2_f_teid_t *teid = NULL; + ogs_assert(mme_ue); ogs_assert(rsp); ogs_debug("Create Indirect Data Forwarding Tunnel Response"); @@ -1386,9 +1354,6 @@ /******************** * Check Transaction ********************/ - ogs_assert(xact); - mme_ue = xact->data; - ogs_assert(mme_ue); sgw_ue = sgw_ue_cycle(mme_ue->sgw_ue); ogs_assert(sgw_ue); @@ -1400,11 +1365,6 @@ ************************/ cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - if (!mme_ue_from_teid) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { mme_send_delete_session_or_mme_ue_context_release(mme_ue); return; @@ -1483,16 +1443,16 @@ } void mme_s11_handle_delete_indirect_data_forwarding_tunnel_response( - ogs_gtp_xact_t *xact, mme_ue_t *mme_ue_from_teid, + ogs_gtp_xact_t *xact, mme_ue_t *mme_ue, ogs_gtp2_delete_indirect_data_forwarding_tunnel_response_t *rsp) { int rv; uint8_t cause_value = 0; ogs_gtp2_cause_t *cause = NULL; int action = 0; - mme_ue_t *mme_ue = NULL; sgw_ue_t *sgw_ue = NULL; + ogs_assert(mme_ue); ogs_assert(rsp); ogs_debug("Delete Indirect Data Forwarding Tunnel Response"); @@ -1503,8 +1463,6 @@ ogs_assert(xact); action = xact->delete_indirect_action; ogs_assert(action); - mme_ue = xact->data; - ogs_assert(mme_ue); sgw_ue = sgw_ue_cycle(mme_ue->sgw_ue); ogs_assert(sgw_ue); @@ -1516,11 +1474,6 @@ ************************/ cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - if (!mme_ue_from_teid) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { mme_send_delete_session_or_mme_ue_context_release(mme_ue); return; @@ -1578,7 +1531,7 @@ } void mme_s11_handle_bearer_resource_failure_indication( - ogs_gtp_xact_t *xact, mme_ue_t *mme_ue_from_teid, + ogs_gtp_xact_t *xact, mme_ue_t *mme_ue, ogs_gtp2_bearer_resource_failure_indication_t *ind) { int rv; @@ -1586,11 +1539,12 @@ mme_bearer_t *bearer = NULL; mme_sess_t *sess = NULL; - mme_ue_t *mme_ue = NULL; sgw_ue_t *sgw_ue = NULL; ogs_debug("Bearer Resource Failure Indication"); + ogs_assert(mme_ue); + /******************** * Check Transaction ********************/ @@ -1599,17 +1553,12 @@ ogs_assert(ind); sess = bearer->sess; ogs_assert(sess); - mme_ue = sess->mme_ue; - ogs_assert(mme_ue); sgw_ue = sgw_ue_cycle(mme_ue->sgw_ue); ogs_assert(sgw_ue); rv = ogs_gtp_xact_commit(xact); ogs_expect_or_return(rv == OGS_OK); - if (!mme_ue_from_teid) - ogs_error("No Context in TEID"); - /******************** * Check Cause Value ********************/
View file
open5gs_2.4.8.202206271119.tar.xz/src/mme/mme-sm.c -> open5gs_2.4.8.202206281008.tar.xz/src/mme/mme-sm.c
Changed
@@ -562,6 +562,13 @@ if (gtp_message.h.teid_presence && gtp_message.h.teid != 0) { /* Cause is not "Context not found" */ mme_ue = mme_ue_find_by_teid(gtp_message.h.teid); + } else if (xact->local_teid) { /* rx no TEID or TEID=0 */ + /* 3GPP TS 29.274 5.5.2: we receive TEID=0 under some + * conditions, such as cause "Session context not found". In those + * cases, we still want to identify the local session which + * originated the message, so try harder by using the TEID we + * locally stored in xact when sending the original request: */ + mme_ue = mme_ue_find_by_teid(xact->local_teid); } switch (gtp_message.h.type) { @@ -572,14 +579,17 @@ mme_s11_handle_echo_response(xact, >p_message.echo_response); break; case OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); mme_s11_handle_create_session_response( xact, mme_ue, >p_message.create_session_response); break; case OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); mme_s11_handle_modify_bearer_response( xact, mme_ue, >p_message.modify_bearer_response); break; case OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); mme_s11_handle_delete_session_response( xact, mme_ue, >p_message.delete_session_response); break; @@ -596,6 +606,7 @@ xact, mme_ue, >p_message.delete_bearer_request); break; case OGS_GTP2_RELEASE_ACCESS_BEARERS_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); mme_s11_handle_release_access_bearers_response( xact, mme_ue, >p_message.release_access_bearers_response); break; @@ -604,16 +615,19 @@ xact, mme_ue, >p_message.downlink_data_notification); break; case OGS_GTP2_CREATE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); mme_s11_handle_create_indirect_data_forwarding_tunnel_response( xact, mme_ue, >p_message.create_indirect_data_forwarding_tunnel_response); break; case OGS_GTP2_DELETE_INDIRECT_DATA_FORWARDING_TUNNEL_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); mme_s11_handle_delete_indirect_data_forwarding_tunnel_response( xact, mme_ue, >p_message.delete_indirect_data_forwarding_tunnel_response); break; case OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); mme_s11_handle_bearer_resource_failure_indication( xact, mme_ue, >p_message.bearer_resource_failure_indication);
View file
open5gs_2.4.8.202206271119.tar.xz/src/mme/s1ap-sctp.c -> open5gs_2.4.8.202206281008.tar.xz/src/mme/s1ap-sctp.c
Changed
@@ -240,8 +240,14 @@ s1ap_event_push(MME_EVT_S1AP_MESSAGE, sock, addr, pkbuf, 0, 0); return; } else { - ogs_fatal("Invalid flag(0x%x)", flags); - ogs_assert_if_reached(); + if (ogs_socket_errno != OGS_EAGAIN) { + ogs_fatal("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)", + size, errno, strerror(errno), flags); + ogs_assert_if_reached(); + } else { + ogs_error("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)", + size, errno, strerror(errno), flags); + } } ogs_pkbuf_free(pkbuf);
View file
open5gs_2.4.8.202206271119.tar.xz/src/sgwc/pfcp-path.c -> open5gs_2.4.8.202206281008.tar.xz/src/sgwc/pfcp-path.c
Changed
@@ -212,6 +212,8 @@ ogs_assert(sess); ogs_assert(xact); + xact->local_seid = sess->sgwc_sxa_seid; + memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_MODIFICATION_REQUEST_TYPE; h.seid = sess->sgwu_sxa_seid; @@ -246,6 +248,7 @@ xact->gtpbuf = ogs_pkbuf_copy(gtpbuf); ogs_expect_or_return_val(xact->gtpbuf, OGS_ERROR); } + xact->local_seid = sess->sgwc_sxa_seid; memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_ESTABLISHMENT_REQUEST_TYPE; @@ -311,6 +314,7 @@ xact->gtpbuf = ogs_pkbuf_copy(gtpbuf); ogs_expect_or_return_val(xact->gtpbuf, OGS_ERROR); } + xact->local_seid = sess->sgwc_sxa_seid; ogs_list_add(&xact->bearer_to_modify_list, &bearer->to_modify_node); @@ -348,6 +352,7 @@ xact->gtpbuf = ogs_pkbuf_copy(gtpbuf); ogs_expect_or_return_val(xact->gtpbuf, OGS_ERROR); } + xact->local_seid = sess->sgwc_sxa_seid; memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_DELETION_REQUEST_TYPE; @@ -373,6 +378,7 @@ ogs_pfcp_header_t h; ogs_assert(xact); + xact->local_seid = sess->sgwc_sxa_seid; memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE;
View file
open5gs_2.4.8.202206271119.tar.xz/src/sgwc/pfcp-sm.c -> open5gs_2.4.8.202206281008.tar.xz/src/sgwc/pfcp-sm.c
Changed
@@ -183,8 +183,16 @@ xact = e->pfcp_xact; ogs_assert(xact); - if (message->h.seid_presence && message->h.seid != 0) + if (message->h.seid_presence && message->h.seid != 0) { sess = sgwc_sess_find_by_seid(message->h.seid); + } else if (xact->local_seid) { /* rx no SEID or SEID=0 */ + /* 3GPP TS 29.244 7.2.2.4.2: we receive SEID=0 under some + * conditions, such as cause "Session context not found". In those + * cases, we still want to identify the local session which + * originated the message, so try harder by using the SEID we + * locally stored in xact when sending the original request: */ + sess = sgwc_sess_find_by_seid(xact->local_seid); + } switch (message->h.type) { case OGS_PFCP_HEARTBEAT_REQUEST_TYPE: @@ -208,44 +216,28 @@ &message->pfcp_association_setup_response); break; case OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE: - if (!message->h.seid_presence) { - ogs_error("No SEID"); - break; - } - + if (!message->h.seid_presence) ogs_error("No SEID"); sgwc_sxa_handle_session_establishment_response( sess, xact, e->gtp_message, &message->pfcp_session_establishment_response); break; case OGS_PFCP_SESSION_MODIFICATION_RESPONSE_TYPE: - if (!message->h.seid_presence) { - ogs_error("No SEID"); - break; - } - + if (!message->h.seid_presence) ogs_error("No SEID"); sgwc_sxa_handle_session_modification_response( sess, xact, e->gtp_message, &message->pfcp_session_modification_response); break; case OGS_PFCP_SESSION_DELETION_RESPONSE_TYPE: - if (!message->h.seid_presence) { - ogs_error("No SEID"); - break; - } - + if (!message->h.seid_presence) ogs_error("No SEID"); sgwc_sxa_handle_session_deletion_response( sess, xact, e->gtp_message, &message->pfcp_session_deletion_response); break; case OGS_PFCP_SESSION_REPORT_REQUEST_TYPE: - if (!message->h.seid_presence) { - ogs_error("No SEID"); - break; - } - + if (!message->h.seid_presence) ogs_error("No SEID"); sgwc_sxa_handle_session_report_request( sess, xact, &message->pfcp_session_report_request); break;
View file
open5gs_2.4.8.202206271119.tar.xz/src/sgwc/s11-handler.c -> open5gs_2.4.8.202206281008.tar.xz/src/sgwc/s11-handler.c
Changed
@@ -688,6 +688,7 @@ ogs_gtp2_f_teid_t *sgw_s1u_teid = NULL, *enb_s1u_teid = NULL; ogs_gtp2_uli_t uli; + ogs_assert(sgwc_ue); ogs_assert(message); rsp = &message->create_bearer_response; ogs_assert(rsp); @@ -714,30 +715,10 @@ rv = ogs_gtp_xact_commit(s11_xact); ogs_expect(rv == OGS_OK); - /************************ - * Check SGWC-UE Context - ************************/ - cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - - if (!sgwc_ue) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_assert(OGS_OK == - sgwc_pfcp_send_bearer_modification_request( - bearer, NULL, NULL, - OGS_PFCP_MODIFY_UL_ONLY|OGS_PFCP_MODIFY_REMOVE)); - ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, - OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE, cause_value); - return; - } - /***************************************** * Check Mandatory/Conditional IE Missing *****************************************/ - ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED); + cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; if (rsp->bearer_contexts.presence == 0) { ogs_error("No Bearer"); @@ -872,6 +853,7 @@ sgwc_bearer_t *bearer = NULL; ogs_gtp2_update_bearer_response_t *rsp = NULL; + ogs_assert(sgwc_ue); ogs_assert(message); rsp = &message->update_bearer_response; ogs_assert(rsp); @@ -898,26 +880,10 @@ rv = ogs_gtp_xact_commit(s11_xact); ogs_expect(rv == OGS_OK); - /************************ - * Check SGWC-UE Context - ************************/ - cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - - if (!sgwc_ue) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp_send_error_message(s5c_xact, sess ? sess->pgw_s5c_teid : 0, - OGS_GTP2_UPDATE_BEARER_RESPONSE_TYPE, cause_value); - return; - } - /***************************************** * Check Mandatory/Conditional IE Missing *****************************************/ - ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED); + cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; if (rsp->bearer_contexts.presence == 0) { ogs_error("No Bearer"); @@ -1004,6 +970,7 @@ sgwc_bearer_t *bearer = NULL; ogs_gtp2_delete_bearer_response_t *rsp = NULL; + ogs_assert(sgwc_ue); ogs_assert(message); rsp = &message->delete_bearer_response; ogs_assert(rsp); @@ -1035,11 +1002,6 @@ ************************/ cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - if (!sgwc_ue) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - if (rsp->linked_eps_bearer_id.presence) { /* * << Linked EPS Bearer ID >> @@ -1111,10 +1073,8 @@ ogs_error("No Cause"); } - if (sgwc_ue) { - ogs_debug(" MME_S11_TEID%d SGW_S11_TEID%d", - sgwc_ue->mme_s11_teid, sgwc_ue->sgw_s11_teid); - } + ogs_debug(" MME_S11_TEID%d SGW_S11_TEID%d", + sgwc_ue->mme_s11_teid, sgwc_ue->sgw_s11_teid); ogs_debug(" SGW_S5C_TEID0x%x PGW_S5C_TEID0x%x", sess->sgw_s5c_teid, sess->pgw_s5c_teid); @@ -1513,6 +1473,7 @@ s5c_xact = ogs_gtp_xact_local_create( sess->gnode, &message->h, pkbuf, gtp_bearer_timeout, bearer); ogs_expect_or_return(s5c_xact); + s5c_xact->local_teid = sess->sgw_s5c_teid; ogs_gtp_xact_associate(s11_xact, s5c_xact);
View file
open5gs_2.4.8.202206271119.tar.xz/src/sgwc/s5c-handler.c -> open5gs_2.4.8.202206281008.tar.xz/src/sgwc/s5c-handler.c
Changed
@@ -79,6 +79,9 @@ ogs_gtp_xact_t *s11_xact = NULL; ogs_gtp_node_t *pgw = NULL; + ogs_assert(sess); + sgwc_ue = sess->sgwc_ue; + ogs_assert(sgwc_ue); ogs_assert(gtpbuf); ogs_assert(message); rsp = &message->create_session_response; @@ -96,30 +99,10 @@ rv = ogs_gtp_xact_commit(s5c_xact); ogs_expect(rv == OGS_OK); - /************************ - * Check Session Context - ************************/ - cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - - if (!sess) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } else { - sgwc_ue = sess->sgwc_ue; - ogs_assert(sgwc_ue); - } - - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); - return; - } - /***************************************** * Check Mandatory/Conditional IE Missing *****************************************/ - ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED); + cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; if (rsp->pgw_s5_s8__s2a_s2b_f_teid_for_pmip_based_interface_or_for_gtp_based_control_plane_interface.presence == 0) { ogs_error("No GTP TEID"); @@ -282,24 +265,29 @@ OGS_PFCP_MODIFY_UL_ONLY|OGS_PFCP_MODIFY_ACTIVATE)); } -void sgwc_s5c_handle_delete_session_response( +void sgwc_s5c_handle_modify_bearer_response( sgwc_sess_t *sess, ogs_gtp_xact_t *s5c_xact, ogs_pkbuf_t *gtpbuf, ogs_gtp2_message_t *message) { int rv; ogs_gtp2_cause_t *cause = NULL; uint8_t cause_value; + int modify_action; sgwc_ue_t *sgwc_ue = NULL; + ogs_pkbuf_t *pkbuf = NULL; ogs_gtp_xact_t *s11_xact = NULL; - ogs_gtp2_delete_session_response_t *rsp = NULL; + ogs_gtp2_modify_bearer_response_t *rsp = NULL; + ogs_assert(sess); + sgwc_ue = sess->sgwc_ue; + ogs_assert(sgwc_ue); ogs_assert(message); - rsp = &message->delete_session_response; + rsp = &message->modify_bearer_response; ogs_assert(rsp); - ogs_debug("Delete Session Response"); + ogs_debug("Modify Bearer Response"); /******************** * Check Transaction @@ -307,34 +295,15 @@ ogs_assert(s5c_xact); s11_xact = s5c_xact->assoc_xact; ogs_assert(s11_xact); + modify_action = s5c_xact->modify_action; rv = ogs_gtp_xact_commit(s5c_xact); ogs_expect(rv == OGS_OK); - /************************ - * Check Session Context - ************************/ - cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - - if (!sess) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } else { - sgwc_ue = sess->sgwc_ue; - ogs_assert(sgwc_ue); - } - - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value); - return; - } - /***************************************** * Check Mandatory/Conditional IE Missing *****************************************/ - ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED); + cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; if (rsp->cause.presence == 0) { ogs_error("No Cause"); @@ -342,9 +311,14 @@ } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value); + if (modify_action == OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST) + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); + else + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); return; } @@ -358,52 +332,67 @@ cause_value = cause->value; if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { ogs_error("GTP Failed CAUSE:%d", cause_value); - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value); + if (modify_action == OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST) + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); + else + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); return; } /******************** * Check ALL Context ********************/ - ogs_assert(sess); ogs_assert(sgwc_ue); + ogs_assert(sess); - /* Remove a pgw session */ ogs_debug(" MME_S11_TEID%d SGW_S11_TEID%d", sgwc_ue->mme_s11_teid, sgwc_ue->sgw_s11_teid); ogs_debug(" SGW_S5C_TEID0x%x PGW_S5C_TEID0x%x", sess->sgw_s5c_teid, sess->pgw_s5c_teid); - /* - * 1. MME sends Delete Session Request to SGW/SMF. - * 2. SMF sends Delete Session Response to SGW/MME. - */ - ogs_assert(OGS_OK == - sgwc_pfcp_send_session_deletion_request(sess, s11_xact, gtpbuf)); + if (modify_action == OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST) { + ogs_assert(OGS_OK == + sgwc_gtp_send_create_session_response(sess, s11_xact)); + } else { + message->h.type = OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE; + message->h.teid = sgwc_ue->mme_s11_teid; + + pkbuf = ogs_gtp2_build_msg(message); + ogs_expect_or_return(pkbuf); + + rv = ogs_gtp_xact_update_tx(s11_xact, &message->h, pkbuf); + ogs_expect_or_return(rv == OGS_OK); + + rv = ogs_gtp_xact_commit(s11_xact); + ogs_expect(rv == OGS_OK); + } } -void sgwc_s5c_handle_modify_bearer_response( +void sgwc_s5c_handle_delete_session_response( sgwc_sess_t *sess, ogs_gtp_xact_t *s5c_xact, ogs_pkbuf_t *gtpbuf, ogs_gtp2_message_t *message) { int rv; ogs_gtp2_cause_t *cause = NULL; uint8_t cause_value; - int modify_action; sgwc_ue_t *sgwc_ue = NULL; - ogs_pkbuf_t *pkbuf = NULL; ogs_gtp_xact_t *s11_xact = NULL; - ogs_gtp2_modify_bearer_response_t *rsp = NULL; + ogs_gtp2_delete_session_response_t *rsp = NULL; + ogs_assert(sess); + sgwc_ue = sess->sgwc_ue; + ogs_assert(sgwc_ue); ogs_assert(message); - rsp = &message->modify_bearer_response; + rsp = &message->delete_session_response; ogs_assert(rsp); - ogs_debug("Modify Bearer Response"); + ogs_debug("Delete Session Response"); /******************** * Check Transaction @@ -411,40 +400,14 @@ ogs_assert(s5c_xact); s11_xact = s5c_xact->assoc_xact; ogs_assert(s11_xact); - modify_action = s5c_xact->modify_action; rv = ogs_gtp_xact_commit(s5c_xact); ogs_expect(rv == OGS_OK); - /************************ - * Check Session Context - ************************/ - cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - - if (!sess) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } else { - sgwc_ue = sess->sgwc_ue; - ogs_assert(sgwc_ue); - } - - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - if (modify_action == OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST) - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); - else - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); - return; - } - /***************************************** * Check Mandatory/Conditional IE Missing *****************************************/ - ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED); + cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; if (rsp->cause.presence == 0) { ogs_error("No Cause"); @@ -452,14 +415,9 @@ } if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - if (modify_action == OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST) - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); - else - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value); return; } @@ -473,44 +431,30 @@ cause_value = cause->value; if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { ogs_error("GTP Failed CAUSE:%d", cause_value); - if (modify_action == OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST) - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, cause_value); - else - ogs_gtp_send_error_message( - s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, - OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE, cause_value); + ogs_gtp_send_error_message( + s11_xact, sgwc_ue ? sgwc_ue->mme_s11_teid : 0, + OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE, cause_value); return; } /******************** * Check ALL Context ********************/ - ogs_assert(sgwc_ue); ogs_assert(sess); + ogs_assert(sgwc_ue); + /* Remove a pgw session */ ogs_debug(" MME_S11_TEID%d SGW_S11_TEID%d", sgwc_ue->mme_s11_teid, sgwc_ue->sgw_s11_teid); ogs_debug(" SGW_S5C_TEID0x%x PGW_S5C_TEID0x%x", sess->sgw_s5c_teid, sess->pgw_s5c_teid); - if (modify_action == OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST) { - ogs_assert(OGS_OK == - sgwc_gtp_send_create_session_response(sess, s11_xact)); - } else { - message->h.type = OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE; - message->h.teid = sgwc_ue->mme_s11_teid; - - pkbuf = ogs_gtp2_build_msg(message); - ogs_expect_or_return(pkbuf); - - rv = ogs_gtp_xact_update_tx(s11_xact, &message->h, pkbuf); - ogs_expect_or_return(rv == OGS_OK); - - rv = ogs_gtp_xact_commit(s11_xact); - ogs_expect(rv == OGS_OK); - } + /* + * 1. MME sends Delete Session Request to SGW/SMF. + * 2. SMF sends Delete Session Response to SGW/MME. + */ + ogs_assert(OGS_OK == + sgwc_pfcp_send_session_deletion_request(sess, s11_xact, gtpbuf)); } void sgwc_s5c_handle_create_bearer_request( @@ -725,6 +669,7 @@ rv = ogs_gtp_xact_update_tx(s11_xact, &message->h, pkbuf); ogs_expect_or_return(rv == OGS_OK); } + s11_xact->local_teid = sgwc_ue->sgw_s11_teid; rv = ogs_gtp_xact_commit(s11_xact); ogs_expect(rv == OGS_OK); @@ -874,6 +819,7 @@ rv = ogs_gtp_xact_update_tx(s11_xact, &message->h, pkbuf); ogs_expect_or_return(rv == OGS_OK); } + s11_xact->local_teid = sgwc_ue->sgw_s11_teid; rv = ogs_gtp_xact_commit(s11_xact); ogs_expect(rv == OGS_OK); @@ -889,6 +835,9 @@ sgwc_ue_t *sgwc_ue = NULL; + ogs_assert(sess); + sgwc_ue = sess->sgwc_ue; + ogs_assert(sgwc_ue); ogs_assert(message); ind = &message->bearer_resource_failure_indication; ogs_assert(ind); @@ -902,17 +851,6 @@ s11_xact = s5c_xact->assoc_xact; ogs_assert(s11_xact); - /************************ - * Check Session Context - ************************/ - if (!sess) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } else { - sgwc_ue = sess->sgwc_ue; - ogs_assert(sgwc_ue); - } - /******************** * Check Cause Value ********************/
View file
open5gs_2.4.8.202206271119.tar.xz/src/sgwc/sgwc-sm.c -> open5gs_2.4.8.202206281008.tar.xz/src/sgwc/sgwc-sm.c
Changed
@@ -157,6 +157,13 @@ if (gtp_message.h.teid_presence && gtp_message.h.teid != 0) { /* Cause is not "Context not found" */ sgwc_ue = sgwc_ue_find_by_teid(gtp_message.h.teid); + } else if (gtp_xact->local_teid) { /* rx no TEID or TEID=0 */ + /* 3GPP TS 29.274 5.5.2: we receive TEID=0 under some + * conditions, such as cause "Session context not found". In those + * cases, we still want to identify the local session which + * originated the message, so try harder by using the TEID we + * locally stored in xact when sending the original request: */ + sgwc_ue = sgwc_ue_find_by_teid(gtp_xact->local_teid); } switch(gtp_message.h.type) { @@ -185,14 +192,17 @@ sgwc_ue, gtp_xact, recvbuf, >p_message); break; case OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); sgwc_s11_handle_create_bearer_response( sgwc_ue, gtp_xact, recvbuf, >p_message); break; case OGS_GTP2_UPDATE_BEARER_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); sgwc_s11_handle_update_bearer_response( sgwc_ue, gtp_xact, recvbuf, >p_message); break; case OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); sgwc_s11_handle_delete_bearer_response( sgwc_ue, gtp_xact, recvbuf, >p_message); break; @@ -245,6 +255,13 @@ if (gtp_message.h.teid_presence && gtp_message.h.teid != 0) { sess = sgwc_sess_find_by_teid(gtp_message.h.teid); + } else if (gtp_xact->local_teid) { /* rx no TEID or TEID=0 */ + /* 3GPP TS 29.274 5.5.2: we receive TEID=0 under some + * conditions, such as cause "Session context not found". In those + * cases, we still want to identify the local session which + * originated the message, so try harder by using the TEID we + * locally stored in xact when sending the original request: */ + sess = sgwc_sess_find_by_teid(gtp_xact->local_teid); } switch(gtp_message.h.type) { @@ -255,17 +272,20 @@ sgwc_handle_echo_response(gtp_xact, >p_message.echo_response); break; case OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); sgwc_s5c_handle_create_session_response( sess, gtp_xact, recvbuf, >p_message); break; - case OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE: - sgwc_s5c_handle_delete_session_response( - sess, gtp_xact, recvbuf, >p_message); - break; case OGS_GTP2_MODIFY_BEARER_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); sgwc_s5c_handle_modify_bearer_response( sess, gtp_xact, recvbuf, >p_message); break; + case OGS_GTP2_DELETE_SESSION_RESPONSE_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); + sgwc_s5c_handle_delete_session_response( + sess, gtp_xact, recvbuf, >p_message); + break; case OGS_GTP2_CREATE_BEARER_REQUEST_TYPE: sgwc_s5c_handle_create_bearer_request( sess, gtp_xact, recvbuf, >p_message); @@ -279,6 +299,7 @@ sess, gtp_xact, recvbuf, >p_message); break; case OGS_GTP2_BEARER_RESOURCE_FAILURE_INDICATION_TYPE: + if (!gtp_message.h.teid_presence) ogs_error("No TEID"); sgwc_s5c_handle_bearer_resource_failure_indication( sess, gtp_xact, recvbuf, >p_message); break;
View file
open5gs_2.4.8.202206271119.tar.xz/src/sgwc/sxa-handler.c -> open5gs_2.4.8.202206281008.tar.xz/src/sgwc/sxa-handler.c
Changed
@@ -157,6 +157,7 @@ ogs_debug("Session Establishment Response"); + ogs_assert(sess); ogs_assert(pfcp_xact); ogs_assert(pfcp_rsp); ogs_assert(recv_message); @@ -171,11 +172,6 @@ cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - if (!sess) { - ogs_warn("No Context"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - if (pfcp_rsp->up_f_seid.presence == 0) { ogs_error("No UP F-SEID"); cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING; @@ -382,6 +378,7 @@ s5c_xact = ogs_gtp_xact_local_create( sess->gnode, &send_message.h, pkbuf, sess_timeout, sess); ogs_expect_or_return(s5c_xact); + s5c_xact->local_teid = sess->sgw_s5c_teid; s5c_xact->modify_action = OGS_GTP_MODIFY_IN_PATH_SWITCH_REQUEST; @@ -419,6 +416,7 @@ s5c_xact = ogs_gtp_xact_local_create( sess->gnode, &recv_message->h, pkbuf, sess_timeout, sess); ogs_expect_or_return(s5c_xact); + s5c_xact->local_teid = sess->sgw_s5c_teid; } ogs_gtp_xact_associate(s11_xact, s5c_xact); @@ -451,6 +449,7 @@ ogs_debug("Session Modification Response"); + ogs_assert(sess); ogs_assert(pfcp_xact); ogs_assert(pfcp_rsp); @@ -460,30 +459,12 @@ cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; if (flags & OGS_PFCP_MODIFY_SESSION) { - if (!sess) { - ogs_warn("No Context"); - - sess = pfcp_xact->data; - ogs_assert(sess); - - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } sgwc_ue = sess->sgwc_ue; ogs_assert(sgwc_ue); } else { bearer = pfcp_xact->data; ogs_assert(bearer); - - if (!sess) { - ogs_warn("No Context"); - - sess = bearer->sess; - ogs_assert(sess); - - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - sgwc_ue = bearer->sgwc_ue; ogs_assert(sgwc_ue); } @@ -752,6 +733,7 @@ s11_xact = ogs_gtp_xact_local_create(sgwc_ue->gnode, &recv_message->h, pkbuf, bearer_timeout, bearer); ogs_expect_or_return(s11_xact); + s11_xact->local_teid = sgwc_ue->sgw_s11_teid; ogs_gtp_xact_associate(s5c_xact, s11_xact); @@ -1041,6 +1023,7 @@ sess->gnode, &recv_message->h, pkbuf, sess_timeout, sess); ogs_expect_or_return(s5c_xact); + s5c_xact->local_teid = sess->sgw_s5c_teid; ogs_gtp_xact_associate(s11_xact, s5c_xact); @@ -1202,16 +1185,12 @@ ogs_debug("Session Deletion Response"); + ogs_assert(sess); ogs_assert(pfcp_xact); ogs_assert(pfcp_rsp); cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - if (!sess) { - ogs_warn("No Context"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - if (pfcp_rsp->cause.presence) { if (pfcp_rsp->cause.u8 != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) { ogs_warn("PFCP Cause%d : Not Accepted", pfcp_rsp->cause.u8); @@ -1320,16 +1299,12 @@ ogs_debug("Session Report Request"); + ogs_assert(sess); ogs_assert(pfcp_xact); ogs_assert(pfcp_req); cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - if (!sess) { - ogs_warn("No Context"); - cause_value = OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND; - } - if (pfcp_req->report_type.presence == 0) { ogs_error("No Report Type"); cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING;
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/binding.c -> open5gs_2.4.8.202206281008.tar.xz/src/smf/binding.c
Changed
@@ -369,6 +369,7 @@ xact = ogs_gtp_xact_local_create( sess->gnode, &h, pkbuf, gtp_bearer_timeout, bearer); ogs_expect_or_return(xact); + xact->local_teid = sess->smf_n4_teid; if (ogs_list_count(&bearer->pf_to_add_list) > 0) xact->update_flags |= OGS_GTP_MODIFY_TFT_UPDATE; @@ -438,6 +439,7 @@ xact = ogs_gtp_xact_local_create( sess->gnode, &h, pkbuf, gtp_bearer_timeout, bearer); ogs_expect_or_return_val(xact, OGS_ERROR); + xact->local_teid = sess->smf_n4_teid; rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK);
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/context.c -> open5gs_2.4.8.202206281008.tar.xz/src/smf/context.c
Changed
@@ -1606,6 +1606,7 @@ OGS_TLV_CLEAR_DATA(&sess->gtp.user_location_information); OGS_TLV_CLEAR_DATA(&sess->gtp.ue_timezone); OGS_TLV_CLEAR_DATA(&sess->gtp.charging_characteristics); + OGS_TLV_CLEAR_DATA(&sess->gtp.v1.qos); OGS_NAS_CLEAR_DATA(&sess->nas.ue_pco);
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/context.h -> open5gs_2.4.8.202206281008.tar.xz/src/smf/context.h
Changed
@@ -333,6 +333,9 @@ uint8_t selection_mode; /* OGS_GTP{1,2}_SELECTION_MODE_*, same in GTPv1C and 2C. */ struct { uint8_t nsapi; + ogs_gtp1_common_flags_t common_flags; + ogs_tlv_octet_t qos; /* Encoded GTPv1C "QoS Profile" IE */ + ogs_gtp1_qos_profile_decoded_t qos_pdec; bool peer_supports_apn_ambr; } v1; /* GTPv1C specific fields */ } gtp; /* Saved from S5-C/Gn */
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/gn-build.c -> open5gs_2.4.8.202206281008.tar.xz/src/smf/gn-build.c
Changed
@@ -27,19 +27,10 @@ static void build_qos_profile_from_session(ogs_gtp1_qos_profile_decoded_t *qos_pdec, const smf_sess_t *sess, const smf_bearer_t *bearer) { - memset(qos_pdec, 0, sizeof(*qos_pdec)); + /* Initialize with defaults retrieved from MS/SGSN: */ + memcpy(qos_pdec, &sess->gtp.v1.qos_pdec, sizeof(*qos_pdec)); qos_pdec->qos_profile.arp = sess->session.qos.arp.priority_level; - qos_pdec->qos_profile.data.reliability_class = 3; /* Unacknowledged GTP and LLC; Acknowledged RLC, Protected data */ - qos_pdec->qos_profile.data.precedence_class = 2; /* Normal priority */ - qos_pdec->qos_profile.data.peak_throughput = 9; /* Up to 256 000 octet/s */ - qos_pdec->qos_profile.data.mean_throughput = 0x1f; /* Best effort */ - qos_pdec->qos_profile.data.delivery_erroneous_sdu = 2; /* Erroneous SDUs are delivered ('yes') */ - qos_pdec->qos_profile.data.delivery_order = 2; /* Without delivery order ('no') */ - qos_pdec->qos_profile.data.max_sdu_size = 0x96; /* 1500 octets */ - qos_pdec->qos_profile.data.residual_ber = 5; /* 1*10^-4, <= 2*10^-4 */ - qos_pdec->qos_profile.data.sdu_error_ratio = 4; /* 1*10^-4 */ - /* 3GPP TS 23.401 Annex E table Table E.3 */ /* Also take into account table 7 in 3GPP TS 23.107 9.1.2.2 */ @@ -102,6 +93,22 @@ qos_pdec->dec_mbr_kbps_ul = sess->session.ambr.uplink / 1000; qos_pdec->dec_gbr_kbps_dl = bearer->qos.gbr.downlink / 1000; qos_pdec->dec_gbr_kbps_ul = bearer->qos.gbr.uplink / 1000; + + /* Don't upgrade values if Common Flags "Upgrade QoS Supported" is 0: */ + if (!sess->gtp.v1.common_flags.upgrade_qos_supported) { + if (sess->gtp.v1.qos_pdec.dec_mbr_kbps_dl > 0) + qos_pdec->dec_mbr_kbps_dl = ogs_min(qos_pdec->dec_mbr_kbps_dl, + sess->gtp.v1.qos_pdec.dec_mbr_kbps_dl); + if (sess->gtp.v1.qos_pdec.dec_mbr_kbps_ul > 0) + qos_pdec->dec_mbr_kbps_ul = ogs_min(qos_pdec->dec_mbr_kbps_ul, + sess->gtp.v1.qos_pdec.dec_mbr_kbps_ul); + if (sess->gtp.v1.qos_pdec.dec_gbr_kbps_dl > 0) + qos_pdec->dec_gbr_kbps_dl = ogs_min(qos_pdec->dec_gbr_kbps_dl, + sess->gtp.v1.qos_pdec.dec_gbr_kbps_dl); + if (sess->gtp.v1.qos_pdec.dec_gbr_kbps_ul > 0) + qos_pdec->dec_gbr_kbps_ul = ogs_min(qos_pdec->dec_gbr_kbps_ul, + sess->gtp.v1.qos_pdec.dec_gbr_kbps_ul); + } } ogs_pkbuf_t *smf_gn_build_create_pdp_context_response( @@ -246,12 +253,16 @@ rsp->ggsn_address_for_user_traffic.data = &pgw_gnu_gsnaddr; rsp->ggsn_address_for_user_traffic.len = gsn_len; - /* QoS Profile: if PCRF changes Bearer QoS, this should be included. */ + /* QoS Profile: if PCRF changes Bearer QoS, apply changes. */ if (sess->gtp.create_session_response_bearer_qos == true) { build_qos_profile_from_session(&qos_pdec, sess, bearer); rsp->quality_of_service_profile.presence = 1; ogs_gtp1_build_qos_profile(&rsp->quality_of_service_profile, &qos_pdec, qos_pdec_buf, OGS_GTP1_QOS_PROFILE_MAX_LEN); + } else { + /* Copy over received QoS Profile from originating Request: */ + memcpy(&rsp->quality_of_service_profile, &sess->gtp.v1.qos, + sizeof(rsp->quality_of_service_profile)); } /* TODO: Charging Gateway Address */ @@ -365,9 +376,14 @@ rsp->charging_id.presence = 1; rsp->charging_id.u32 = sess->charging.id; - /* Protocol Configuration Options (PCO) */ - if (sess->gtp.ue_pco.presence && - sess->gtp.ue_pco.len && sess->gtp.ue_pco.data) { + /* Protocol Configuration Options (PCO): + * If the "No QoS negotiation" bit of the Common Flags IE in the Update PDP + * Context Request message was set to 1, then the GGSN ... shall not + * include the Protocol Configuration Options (PCO) information element in + * the message) */ + if (!sess->gtp.v1.common_flags.no_qos_negotiation && + sess->gtp.ue_pco.presence && + sess->gtp.ue_pco.len && sess->gtp.ue_pco.data) { pco_len = smf_pco_build( pco_buf, sess->gtp.ue_pco.data, sess->gtp.ue_pco.len); ogs_assert(pco_len > 0); @@ -437,12 +453,18 @@ rsp->ggsn_address_for_user_traffic.data = &pgw_gnu_gsnaddr; rsp->ggsn_address_for_user_traffic.len = gsn_len; - /* QoS Profile: if PCRF changes Bearer QoS, this should be included. */ - if (sess->gtp.create_session_response_bearer_qos == true) { + /* QoS Profile: if SGSN supports QoS re-negotiation and PCRF changes Bearer + * QoS, apply changes: */ + if (!sess->gtp.v1.common_flags.no_qos_negotiation && + sess->gtp.create_session_response_bearer_qos == true) { build_qos_profile_from_session(&qos_pdec, sess, bearer); rsp->quality_of_service_profile.presence = 1; ogs_gtp1_build_qos_profile(&rsp->quality_of_service_profile, &qos_pdec, qos_pdec_buf, OGS_GTP1_QOS_PROFILE_MAX_LEN); + } else { + /* Copy over received QoS Profile from originating Request: */ + memcpy(&rsp->quality_of_service_profile, &sess->gtp.v1.qos, + sizeof(rsp->quality_of_service_profile)); } /* TODO: Charging Gateway Address */
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/gn-handler.c -> open5gs_2.4.8.202206281008.tar.xz/src/smf/gn-handler.c
Changed
@@ -62,7 +62,7 @@ smf_ue_t *smf_ue = NULL; ogs_eua_t *eua = NULL; smf_bearer_t *bearer = NULL; - ogs_gtp1_qos_profile_decoded_t qos_pdec; + ogs_gtp1_qos_profile_decoded_t *qos_pdec; uint8_t qci = 9; ogs_assert(sess); @@ -178,27 +178,33 @@ smf_ue->msisdn, smf_ue->msisdn_len, smf_ue->msisdn_bcd); } - /* Set some sane default if infomation not present in Qos Profile or APN-AMBR: */ + /* Common Flags 7.7.48 */ + if (req->common_flags.presence) { + sess->gtp.v1.common_flags = *(ogs_gtp1_common_flags_t*)req->common_flags.data; + } + + /* Set some sane default if information not present in QoS Profile or APN-AMBR: */ sess->session.ambr.downlink = 102400000; sess->session.ambr.uplink = 102400000; /* Set Bearer QoS */ - rv = ogs_gtp1_parse_qos_profile(&qos_pdec, - &req->quality_of_service_profile); + OGS_TLV_STORE_DATA(&sess->gtp.v1.qos, &req->quality_of_service_profile); + qos_pdec = &sess->gtp.v1.qos_pdec; + rv = ogs_gtp1_parse_qos_profile(qos_pdec, &req->quality_of_service_profile); if(rv < 0) return OGS_GTP1_CAUSE_MANDATORY_IE_INCORRECT; /* 3GPP TS 23.060 section 9.2.1A: "The QoS profiles of the PDP context and EPS bearer are mapped as specified in TS 23.401" * 3GPP TS 23.401 Annex E: "Mapping between EPS and Release 99 QoS parameters" */ - ogs_gtp1_qos_profile_to_qci(&qos_pdec, &qci); + ogs_gtp1_qos_profile_to_qci(qos_pdec, &qci); sess->session.qos.index = qci; - sess->session.qos.arp.priority_level = qos_pdec.qos_profile.arp; /* 3GPP TS 23.401 Annex E Table E.2 */ + sess->session.qos.arp.priority_level = qos_pdec->qos_profile.arp; /* 3GPP TS 23.401 Annex E Table E.2 */ sess->session.qos.arp.pre_emption_capability = 0; /* ignored as per 3GPP TS 23.401 Annex E */ sess->session.qos.arp.pre_emption_vulnerability = 0; /* ignored as per 3GPP TS 23.401 Annex E */ - if (qos_pdec.data_octet6_to_13_present) { - sess->session.ambr.downlink = qos_pdec.dec_mbr_kbps_dl * 1000; - sess->session.ambr.uplink = qos_pdec.dec_mbr_kbps_ul * 1000; + if (qos_pdec->data_octet6_to_13_present) { + sess->session.ambr.downlink = qos_pdec->dec_mbr_kbps_dl * 1000; + sess->session.ambr.uplink = qos_pdec->dec_mbr_kbps_ul * 1000; } /* APN-AMBR, 7.7.98 */ @@ -266,9 +272,9 @@ ogs_assert(rv == OGS_OK); ogs_debug(" SGW_S5U_TEID0x%x PGW_S5U_TEID0x%x", bearer->sgw_s5u_teid, bearer->pgw_s5u_teid); - if (qos_pdec.data_octet6_to_13_present) { - bearer->qos.gbr.downlink = qos_pdec.dec_gbr_kbps_dl * 1000; - bearer->qos.gbr.uplink = qos_pdec.dec_gbr_kbps_ul * 1000; + if (qos_pdec->data_octet6_to_13_present) { + bearer->qos.gbr.downlink = qos_pdec->dec_gbr_kbps_dl * 1000; + bearer->qos.gbr.uplink = qos_pdec->dec_gbr_kbps_ul * 1000; } else { /* Set some sane default if infomation not present in Qos Profile IE: */ bearer->qos.gbr.downlink = sess->session.ambr.downlink; @@ -324,6 +330,8 @@ ogs_pfcp_pdr_t *pdr = NULL; smf_bearer_t *bearer = NULL; smf_ue_t *smf_ue = NULL; + ogs_gtp1_qos_profile_decoded_t *qos_pdec; + uint8_t qci; ogs_debug("Update PDP Context Request"); @@ -382,6 +390,14 @@ } } + /* Common Flags 7.7.48 */ + if (req->common_flags.presence) { + sess->gtp.v1.common_flags = *(ogs_gtp1_common_flags_t*)req->common_flags.data; + } else { + /* Reset it to overwrite what was received during CreatePDPCtxReq time */ + sess->gtp.v1.common_flags = (ogs_gtp1_common_flags_t){0}; + } + /* Control Plane(DL) : SGW-S5C */ if (req->tunnel_endpoint_identifier_control_plane.presence) { sess->sgw_s5c_teid = req->tunnel_endpoint_identifier_control_plane.u32; @@ -402,6 +418,50 @@ ogs_debug(" Updated SGW_S5U_TEID0x%x PGW_S5U_TEID0x%x", bearer->sgw_s5u_teid, bearer->pgw_s5u_teid); + + /* Set Bearer QoS */ + OGS_TLV_STORE_DATA(&sess->gtp.v1.qos, &req->quality_of_service_profile); + qos_pdec = &sess->gtp.v1.qos_pdec; + rv = ogs_gtp1_parse_qos_profile(qos_pdec, &req->quality_of_service_profile); + if(rv < 0) { + ogs_gtp1_send_error_message(xact, sess->sgw_s5c_teid, + OGS_GTP1_UPDATE_PDP_CONTEXT_RESPONSE_TYPE, + OGS_GTP1_CAUSE_MANDATORY_IE_INCORRECT); + return; + } + + /* 3GPP TS 23.060 section 9.2.1A: "The QoS profiles of the PDP context and EPS bearer are mapped as specified in TS 23.401" + * 3GPP TS 23.401 Annex E: "Mapping between EPS and Release 99 QoS parameters" + */ + ogs_gtp1_qos_profile_to_qci(qos_pdec, &qci); + sess->session.qos.index = qci; + sess->session.qos.arp.priority_level = qos_pdec->qos_profile.arp; /* 3GPP TS 23.401 Annex E Table E.2 */ + sess->session.qos.arp.pre_emption_capability = 0; /* ignored as per 3GPP TS 23.401 Annex E */ + sess->session.qos.arp.pre_emption_vulnerability = 0; /* ignored as per 3GPP TS 23.401 Annex E */ + if (qos_pdec->data_octet6_to_13_present) { + sess->session.ambr.downlink = qos_pdec->dec_mbr_kbps_dl * 1000; + sess->session.ambr.uplink = qos_pdec->dec_mbr_kbps_ul * 1000; + } + + /* APN-AMBR, 7.7.98 */ + if (req->apn_ambr.presence) { + /* "The APN-AMBR IE shall be included as the authorized APN-AMBR if the + * GGSN supports this IE and if the APN-AMBR IE has been included in the + * corresponding request message." */ + sess->gtp.v1.peer_supports_apn_ambr = true; + if (req->apn_ambr.len >= sizeof(ogs_gtp1_apn_ambr_t)) { + ogs_gtp1_apn_ambr_t *ambr = req->apn_ambr.data; + sess->session.ambr.uplink = be32toh(ambr->uplink) * 1000; + sess->session.ambr.downlink = be32toh(ambr->downlink) * 1000; + } + } + + /* PCO */ + if (req->protocol_configuration_options.presence) { + OGS_TLV_STORE_DATA(&sess->gtp.ue_pco, + &req->protocol_configuration_options); + } + memset(&h, 0, sizeof(ogs_gtp2_header_t)); h.type = OGS_GTP1_UPDATE_PDP_CONTEXT_RESPONSE_TYPE; h.teid = sess->sgw_s5c_teid;
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/gtp-path.c -> open5gs_2.4.8.202206281008.tar.xz/src/smf/gtp-path.c
Changed
@@ -542,6 +542,7 @@ xact = ogs_gtp_xact_local_create( sess->gnode, &h, pkbuf, bearer_timeout, bearer); ogs_expect_or_return_val(xact, OGS_ERROR); + xact->local_teid = sess->smf_n4_teid; rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK);
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/n4-handler.c -> open5gs_2.4.8.202206281008.tar.xz/src/smf/n4-handler.c
Changed
@@ -255,6 +255,7 @@ ogs_debug("Session Modification Response 5gc"); + ogs_assert(sess); ogs_assert(xact); ogs_assert(rsp); @@ -279,11 +280,6 @@ status = OGS_SBI_HTTP_STATUS_OK; - if (!sess) { - ogs_warn("No Context"); - status = OGS_SBI_HTTP_STATUS_NOT_FOUND; - } - if (rsp->cause.presence) { if (rsp->cause.u8 != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) { ogs_warn("PFCP Cause %d : Not Accepted", rsp->cause.u8); @@ -624,10 +620,7 @@ status = OGS_SBI_HTTP_STATUS_OK; - if (!sess) { - ogs_warn("No Context"); - status = OGS_SBI_HTTP_STATUS_NOT_FOUND; - } + ogs_assert(sess); if (rsp->cause.presence) { if (rsp->cause.u8 != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) { @@ -669,8 +662,6 @@ return status; } - ogs_assert(sess); - return status; } @@ -803,6 +794,7 @@ OGS_LIST(pdr_to_create_list); + ogs_assert(sess); ogs_assert(xact); ogs_assert(rsp); @@ -831,11 +823,6 @@ ogs_pfcp_xact_commit(xact); - if (!sess) { - ogs_error("No Context"); - return; - } - if (rsp->cause.presence) { if (rsp->cause.u8 != OGS_PFCP_CAUSE_REQUEST_ACCEPTED) { ogs_error("PFCP Cause %d : Not Accepted", rsp->cause.u8); @@ -1111,6 +1098,7 @@ uint16_t pdr_id = 0; unsigned int i; + ogs_assert(sess); ogs_assert(pfcp_xact); ogs_assert(pfcp_req); @@ -1118,11 +1106,6 @@ cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - if (!sess) { - ogs_warn("No Context"); - cause_value = OGS_PFCP_CAUSE_SESSION_CONTEXT_NOT_FOUND; - } - if (pfcp_req->report_type.presence == 0) { ogs_error("No Report Type"); cause_value = OGS_GTP2_CAUSE_MANDATORY_IE_MISSING; @@ -1135,7 +1118,6 @@ return; } - ogs_assert(sess); report_type.value = pfcp_req->report_type.u8; if (report_type.downlink_data_report) {
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/pfcp-path.c -> open5gs_2.4.8.202206281008.tar.xz/src/smf/pfcp-path.c
Changed
@@ -329,6 +329,8 @@ ogs_assert(sess); ogs_assert(xact); + xact->local_seid = sess->smf_n4_seid; + memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_MODIFICATION_REQUEST_TYPE; h.seid = sess->upf_n4_seid; @@ -366,6 +368,7 @@ ogs_expect_or_return_val(xact, OGS_ERROR); xact->assoc_stream = stream; + xact->local_seid = sess->smf_n4_seid; memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_ESTABLISHMENT_REQUEST_TYPE; @@ -450,6 +453,7 @@ xact->assoc_stream = stream; xact->delete_trigger = trigger; + xact->local_seid = sess->smf_n4_seid; memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_DELETION_REQUEST_TYPE; @@ -482,6 +486,7 @@ xact->epc = true; /* EPC PFCP transaction */ xact->assoc_xact = gtp_xact; + xact->local_seid = sess->smf_n4_seid; memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_ESTABLISHMENT_REQUEST_TYPE; @@ -604,6 +609,7 @@ * - Delete Bearer Request/Response with DEDICATED BEARER. */ xact->assoc_xact = gtp_xact; + xact->local_seid = sess->smf_n4_seid; memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_DELETION_REQUEST_TYPE; @@ -683,6 +689,7 @@ ogs_pfcp_header_t h; ogs_assert(xact); + xact->local_seid = sess->smf_n4_seid; memset(&h, 0, sizeof(ogs_pfcp_header_t)); h.type = OGS_PFCP_SESSION_REPORT_RESPONSE_TYPE;
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/pfcp-sm.c -> open5gs_2.4.8.202206281008.tar.xz/src/smf/pfcp-sm.c
Changed
@@ -185,8 +185,16 @@ xact = e->pfcp_xact; ogs_assert(xact); - if (message->h.seid_presence && message->h.seid != 0) - sess = smf_sess_find_by_seid(message->h.seid); + if (message->h.seid_presence && message->h.seid != 0) { + sess = smf_sess_find_by_seid(message->h.seid); + } else if (xact->local_seid) { /* rx no SEID or SEID=0 */ + /* 3GPP TS 29.244 7.2.2.4.2: we receive SEID=0 under some + * conditions, such as cause "Session context not found". In those + * cases, we still want to identify the local session which + * originated the message, so try harder by using the SEID we + * locally stored in xact when sending the original request: */ + sess = smf_sess_find_by_seid(xact->local_seid); + } if (sess) e->sess = sess; @@ -212,30 +220,13 @@ &message->pfcp_association_setup_response); break; case OGS_PFCP_SESSION_ESTABLISHMENT_RESPONSE_TYPE: - if (!message->h.seid_presence) - ogs_error("No SEID"); - if (!sess) { - ogs_gtp_xact_t *gtp_xact = xact->assoc_xact; - ogs_assert(gtp_xact); - if (gtp_xact->gtp_version == 1) - ogs_gtp1_send_error_message(gtp_xact, 0, - OGS_GTP1_CREATE_PDP_CONTEXT_RESPONSE_TYPE, - OGS_GTP1_CAUSE_CONTEXT_NOT_FOUND); - else - ogs_gtp2_send_error_message(gtp_xact, 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, - OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); - break; - } + if (!message->h.seid_presence) ogs_error("No SEID"); + ogs_assert(sess); ogs_fsm_dispatch(&sess->sm, e); break; case OGS_PFCP_SESSION_MODIFICATION_RESPONSE_TYPE: - if (!message->h.seid_presence) { - ogs_error("No SEID"); - break; - } - + if (!message->h.seid_presence) ogs_error("No SEID"); if (xact->epc) smf_epc_n4_handle_session_modification_response( sess, xact, e->gtp2_message, @@ -246,32 +237,13 @@ break; case OGS_PFCP_SESSION_DELETION_RESPONSE_TYPE: - if (!message->h.seid_presence) - ogs_error("No SEID"); - if (!sess) { - ogs_gtp_xact_t *gtp_xact = xact->assoc_xact; - if (!gtp_xact) - break; - if (gtp_xact->gtp_version == 1) - ogs_gtp1_send_error_message(gtp_xact, 0, - OGS_GTP1_CREATE_PDP_CONTEXT_RESPONSE_TYPE, - OGS_GTP1_CAUSE_CONTEXT_NOT_FOUND); - else - ogs_gtp2_send_error_message(gtp_xact, 0, - OGS_GTP2_CREATE_SESSION_RESPONSE_TYPE, - OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND); - break; - } - + if (!message->h.seid_presence) ogs_error("No SEID"); + ogs_assert(sess); ogs_fsm_dispatch(&sess->sm, e); break; case OGS_PFCP_SESSION_REPORT_REQUEST_TYPE: - if (!message->h.seid_presence) { - ogs_error("No SEID"); - break; - } - + if (!message->h.seid_presence) ogs_error("No SEID"); smf_n4_handle_session_report_request( sess, xact, &message->pfcp_session_report_request); break;
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/s5c-handler.c -> open5gs_2.4.8.202206281008.tar.xz/src/smf/s5c-handler.c
Changed
@@ -595,6 +595,7 @@ smf_bearer_t *bearer = NULL; ogs_pfcp_far_t *dl_far = NULL; + ogs_assert(sess); ogs_assert(rsp); ogs_debug("Create Bearer Response"); @@ -614,11 +615,6 @@ ************************/ cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - if (!sess) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { ogs_assert(OGS_OK == smf_epc_pfcp_send_one_bearer_modification_request( @@ -770,6 +766,7 @@ uint64_t pfcp_flags = 0; smf_bearer_t *bearer = NULL; + ogs_assert(sess); ogs_assert(rsp); ogs_debug("Update Bearer Response"); @@ -786,24 +783,10 @@ rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK); - /************************ - * Check Session Context - ************************/ - cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; - - if (!sess) { - ogs_error("No Context in TEID"); - cause_value = OGS_GTP2_CAUSE_CONTEXT_NOT_FOUND; - } - - if (cause_value != OGS_GTP2_CAUSE_REQUEST_ACCEPTED) { - return; - } - /***************************************** * Check Mandatory/Conditional IE Missing *****************************************/ - ogs_assert(cause_value == OGS_GTP2_CAUSE_REQUEST_ACCEPTED); + cause_value = OGS_GTP2_CAUSE_REQUEST_ACCEPTED; if (rsp->bearer_contexts.presence == 0) { ogs_error("No Bearer"); @@ -887,6 +870,7 @@ uint8_t cause_value; smf_bearer_t *bearer = NULL; + ogs_assert(sess); ogs_assert(rsp); ogs_debug("Delete Bearer Response"); @@ -901,18 +885,10 @@ rv = ogs_gtp_xact_commit(xact); ogs_expect(rv == OGS_OK); - /************************ - * Check Session Context - ************************/ - if (!sess) - ogs_error("No Context in TEID"); - /******************** * Check ALL Context ********************/ ogs_assert(bearer); - sess = bearer->sess; - ogs_assert(sess); if (rsp->linked_eps_bearer_id.presence) { /*
View file
open5gs_2.4.8.202206271119.tar.xz/src/smf/smf-sm.c -> open5gs_2.4.8.202206281008.tar.xz/src/smf/smf-sm.c
Changed
@@ -115,8 +115,15 @@ } e->gtp_xact = gtp_xact; - if (gtp2_message.h.teid != 0) { + if (gtp2_message.h.teid_presence && gtp2_message.h.teid != 0) { sess = smf_sess_find_by_teid(gtp2_message.h.teid); + } else if (gtp_xact->local_teid) { /* rx no TEID or TEID=0 */ + /* 3GPP TS 29.274 5.5.2: we receive TEID=0 under some + * conditions, such as cause "Session context not found". In those + * cases, we still want to identify the local session which + * originated the message, so try harder by using the TEID we + * locally stored in xact when sending the original request: */ + sess = smf_sess_find_by_teid(gtp_xact->local_teid); } switch(gtp2_message.h.type) { @@ -161,18 +168,18 @@ sess, gtp_xact, recvbuf, >p2_message.modify_bearer_request); break; case OGS_GTP2_CREATE_BEARER_RESPONSE_TYPE: + if (!gtp2_message.h.teid_presence) ogs_error("No TEID"); smf_s5c_handle_create_bearer_response( sess, gtp_xact, >p2_message.create_bearer_response); break; case OGS_GTP2_UPDATE_BEARER_RESPONSE_TYPE: + if (!gtp2_message.h.teid_presence) ogs_error("No TEID"); smf_s5c_handle_update_bearer_response( sess, gtp_xact, >p2_message.update_bearer_response); break; case OGS_GTP2_DELETE_BEARER_RESPONSE_TYPE: - if (!sess) { - /* TODO: NACK the message */ - break; - } + if (!gtp2_message.h.teid_presence) ogs_error("No TEID"); + ogs_assert(sess); e->sess = sess; ogs_fsm_dispatch(&sess->sm, e); break;
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
.