mirror of
https://github.com/open5gs/open5gs.git
synced 2026-05-19 16:27:27 +00:00
mirror of https://github.com/open5gs/open5gs link from https://open5gs.org/
https://open5gs.org
Two follow-ups to the admin-endpoints series, addressing concerns that surfaced in pre-submission review: 1. Defer the ?purge=true cleanup off the SBI handler stack frame. The MME and AMF admin handlers previously called mme_ue_remove() / amf_ue_remove() inline after sending the 204 response. Open5GS schedules cross-event references via pool ids rather than raw pointers, so this is not a textbook use-after-free, but it does break the convention that every other state-removing trigger in these NFs (T3412/T3512 expiry, S6a/UDM Cancel, ordinary detach/deregistration) follows: state teardown happens in the main event loop, not from inside an inbound message handler. This commit adds two new event types -- MME_EVENT_ADMIN_UE_PURGE and AMF_EVENT_ADMIN_UE_PURGE -- and posts them onto ogs_app()->queue right after the 204 has been put on the wire. The respective state_operational() handler re-resolves the pool id via mme_ue_find_by_id() / amf_ue_find_by_id() and silently no-ops if the context disappeared in the meantime, then calls the normal _remove() path from a clean stack frame. This isolates the heavy cleanup (timer cancellation, child-list teardown, pool free) from any state the SBI handler still holds on its stack, and matches the dispatch convention reviewers expect from cleanup paths in the project. 2. Compile-time alignment guard for the MME event header. mme-init.c reads ((ogs_event_t *)e)->id before the FSM dispatch to divert OGS_EVENT_SBI_SERVER events to the synchronous admin handler. That cast is well-defined only because both ogs_event_t and mme_event_t place int id at offset 0 -- a convention maintained today by manual care. Adding OGS_STATIC_ASSERT(offsetof(mme_event_t, id) == offsetof(ogs_event_t, id)) turns the convention into a build-time check so any future reordering of mme_event_t breaks the build instead of silently corrupting the diversion logic. AMF does not need an equivalent assert because amf_event_t embeds ogs_event_t as its first member (`ogs_event_t h;`); the cast is trivially well-defined there. Signed-off-by: MrBrownieCGN <daniel.brune.so@outlook.com> |
||
|---|---|---|
| .github | ||
| configs | ||
| debian | ||
| docker | ||
| docs | ||
| lib | ||
| misc | ||
| src | ||
| subprojects | ||
| tests | ||
| vagrant | ||
| webui | ||
| .clang-tidy | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitignore | ||
| LICENSE | ||
| meson.build | ||
| meson_options.txt | ||
| README.md | ||
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.
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.
