mirror of
https://github.com/open5gs/open5gs.git
synced 2025-11-02 04:53:37 +00:00
bca0a7b6e01d254f4223b83831162566d4626428
When SM Context creation fails (e.g. 504 from SMF) the AMF continued
to build and send a NAS downlink message by dynamically looking up
the AMF UE context from ran_ue->amf_ue_id inside ngap_build_downlink_nas_transport().
If ran_ue_deassociate() had already removed that mapping, the lookup
would return NULL, triggering a fatal assertion and crashing the AMF.
This patch changes:
1. nas_5gs_send_to_downlink_nas_transport() and
ngap_build_downlink_nas_transport() signatures to accept an
explicit amf_ue_t * parameter alongside ran_ue_t *.
2. All calls to nas_5gs_send_to_downlink_nas_transport() to pass
the correct amf_ue pointer (from sess->amf_ue_id).
3. Removal of the dynamic lookup and fatal assertion in
ngap_build_downlink_nas_transport(), replacing it with
ogs_assert(amf_ue) on the passed-in context.
By carrying the valid AMF UE context through the call chain, we
ensure that downlink NAS transport always has a correct pointer,
even when the ran_ue-to-amf_ue mapping has been cleared. This
prevents invalid internal state transitions and eliminates the
ngap_build_downlink_nas_transport() crash when handling SMF failures.
Getting Started
Please follow the documentation at open5gs.org!
Sponsors
If you find Open5GS useful for work, please consider supporting this Open Source project by Becoming a sponsor. To manage the funding transactions transparently, you can donate through OpenCollective.
Special Sponsor
Community
- Problem with Open5GS can be filed as issues in this repository.
- Other topics related to this project are happening on the discussions.
- Voice and text chat are available in Open5GS's Discord workspace. Use this link to get started.
Contributing
If you're contributing through a pull request to Open5GS project on GitHub, please read the Contributor License Agreement in advance.
License
- Open5GS Open Source files are made available under the terms of the GNU Affero General Public License (GNU AGPL v3.0).
- Commercial licenses are also available from NewPlane at sales@newplane.io.
Support
Technical support and customized services for Open5GS are provided by NewPlane at support@newplane.io.
Languages
C
97.6%
Mustache
0.9%
JavaScript
0.5%
Meson
0.5%
Python
0.3%
Other
0.2%
