open5gs/tests/af
Sukchan Lee 783b1dc26f sbi: avoid duplicate NF status subscriptions and clean up local entries on DELETE
This patch addresses a potential subscription_data pool exhaustion
issue observed during repeated NF re-registration with the NRF.

Two improvements are introduced:

1) Prevent duplicate NF status subscriptions
   Before sending a new NF status subscription request, the code now
   checks whether an equivalent subscription already exists in the
   local subscription_data list. If a matching subscription (based on
   req_nf_instance_id and subscr_cond) is found and it is not already
   marked with DELETE_SENT, the new subscription request is skipped.

   This prevents repeated subscription creation during re-registration
   loops.

2) Ensure local cleanup after DELETE response
   When handling HTTP DELETE responses for NF status subscriptions,
   the local subscription_data entry is now removed regardless of the
   response status. Previously, the entry was only removed on
   HTTP 204 (No Content), which could leave stale entries in the local
   list when the NRF returned other statuses (e.g., 404).

   Keeping stale entries could lead to unbounded growth of
   subscription_data and eventual pool exhaustion.

Additionally, successful DELETE operations are logged to improve
debugging visibility.

This change affects all NF state machines that handle subscription
DELETE responses (AMF, AUSF, BSF, NSSF, PCF, SCP, SEPP, SMF, UDM, UDR,
and AF test code).

Issues: #4207
2026-03-13 16:46:00 +09:00
..
af-sm.c sbi: avoid duplicate NF status subscriptions and clean up local entries on DELETE 2026-03-13 16:46:00 +09:00
af-sm.h Move src/../nf-sm.[ch] to lib/sbi/nf-sm.[ch] 2022-08-12 14:03:53 +09:00
context.c [SBI] Generate URI via HTTP.location as is (#3058) 2024-04-18 21:24:07 +09:00
context.h [SBI] Generate URI via HTTP.location as is (#3058) 2024-04-18 21:24:07 +09:00
event.c Added Service-based NF discovery 2022-09-02 23:04:57 +09:00
event.h SCP(Model D) is now the default setting. 2022-10-22 11:26:04 +09:00
init.c Typos Fix 2025-04-19 20:45:25 +09:00
init.h Move src/../nf-sm.[ch] to lib/sbi/nf-sm.[ch] 2022-08-12 14:03:53 +09:00
local.c Added Service-based NF discovery 2022-09-02 23:04:57 +09:00
local.h [SBI] Support service-names in discovery option 2022-08-27 00:12:22 +09:00
meson.build Move src/../nf-sm.[ch] to lib/sbi/nf-sm.[ch] 2022-08-12 14:03:53 +09:00
nbsf-build.c SCP(Model D) is now the default setting. 2022-10-22 11:26:04 +09:00
nbsf-build.h [5GC] Added BSF(Binding Support Function) 2021-05-29 15:56:12 +09:00
nbsf-handler.c [SEPP] Initial Update for 5G Roaming (#2739) 2023-11-19 19:34:51 +09:00
nbsf-handler.h [5GC] Added BSF(Binding Support Function) 2021-05-29 15:56:12 +09:00
nnrf-handler.c [SBI] SearchResult.validityPeriod 3600->30s (#3210) 2024-05-17 14:54:32 +09:00
nnrf-handler.h Move src/../nf-sm.[ch] to lib/sbi/nf-sm.[ch] 2022-08-12 14:03:53 +09:00
npcf-build.c [all] allow value of 0 for S-NSSAI SST 2025-01-11 20:22:46 +09:00
npcf-build.h VoNR added but not tested! 2021-11-14 21:07:56 +09:00
npcf-handler.c [DBI] Improve YAML policy config by adding SUPI range filtering 2025-02-05 21:56:15 +09:00
npcf-handler.h VoNR added but not tested! 2021-11-14 21:07:56 +09:00
sbi-path.c [SBI] Fix double-free 2026-01-31 20:17:58 +09:00
sbi-path.h SCP(Model D) is now the default setting. 2022-10-22 11:26:04 +09:00