open5gs/tests/core
Sukchan Lee f9fed3ca13 [AMF/MME] Preserve RAN node ID indexes across association replacement
A gNB/eNB can register the same node ID on a new SCTP association before
the old association's shutdown is processed. Removing the old context
can then delete the replacement's ID mapping. This caused the macOS N2
handover test to hang: the AMF could not find the target gNB despite its
successful NG Setup, while the test waited for a Handover Request.

Owner-checked removal alone is insufficient. ogs_hash_set() replaces
only the value of an existing entry, retaining the key pointer into
the old context. Subsequent ID reassignment or pool reuse can therefore
break lookups even when the replacement's mapping is not deleted.

Add ogs_hash_set_rekey() to remove and reinsert an entry with the
supplied key pointer, leaving ordinary ogs_hash_set() semantics intact.
Use it for gNB-ID and eNB-ID registration, and use the existing
ogs_hash_unset_if_owner() when removing contexts or unindexing their
previous IDs before reassignment.

Document why both operations are needed and the caller's responsibility
for key lifetime and access serialization. Keep the existing ID
replacement policy and association lifetime unchanged.

Add core and AMF/MME regression tests covering key replacement,
displaced-owner cleanup, old key storage changes, ID reassignment,
repeated registration and ID 0.
2026-09-30 16:39:27 +09:00
..
abts-main.c Fixed dynamic-stack-buffer-overflow (#2578, #2577) 2023-09-05 21:58:05 +09:00
conv-test.c core: fix 1-byte OOB write in ogs_buffer_to_bcd() 2026-09-19 10:47:46 +09:00
fsm-test.c Move src/../nf-sm.[ch] to lib/sbi/nf-sm.[ch] 2022-08-12 14:03:53 +09:00
hash-test.c [AMF/MME] Preserve RAN node ID indexes across association replacement 2026-09-30 16:39:27 +09:00
list-test.c refine SGW/UPF selection code 2020-07-09 01:38:09 -04:00
log-test.c Rename Project to Open5GS 2019-10-27 17:41:14 +09:00
memory-test.c [PFCP/GTP] SEID/TEID Randomness (#1303) 2023-04-16 12:30:36 +09:00
meson.build refine SGW/UPF selection code 2020-07-09 01:38:09 -04:00
pkbuf-test.c Rename Project to Open5GS 2019-10-27 17:41:14 +09:00
poll-test.c Fix to avoid port (7777) conflicts on Mac OS X 2022-10-30 13:58:28 +09:00
pool-test.c Rename Project to Open5GS 2019-10-27 17:41:14 +09:00
queue-test.c Revert "tests: Fix Clang warning and stabilize GUTI registration" 2026-09-29 08:58:43 +09:00
rbtree-test.c Rename Project to Open5GS 2019-10-27 17:41:14 +09:00
socket-test.c Fix to avoid port (7777) conflicts on Mac OS X 2022-10-30 13:58:28 +09:00
strings-test.c Rename Project to Open5GS 2019-10-27 17:41:14 +09:00
thread-test.c Rename Project to Open5GS 2019-10-27 17:41:14 +09:00
time-test.c refine SGW/UPF selection code 2020-07-09 01:38:09 -04:00
timer-test.c Fix the MacOSX CI (#1454) 2022-03-31 23:06:52 +09:00
tlv-test.c core: fix 32-bit TLV decoding and extend GTPv1 fuzzing 2026-09-16 13:31:17 +09:00
uuid-test.c Added NRF 2020-05-18 17:00:37 -04:00