Files
open5gs/lib/core
Sukchan Lee 753523033d [SMF] Refactor core address‐resolution to robustly support both IP literals and hostnames (#4008)
This change revises the existing ogs_addaddrinfo() function to handle
partial failures without aborting the process, ensure proper cleanup
of any nodes allocated before an error, and emit more informative logs
(including getaddrinfo() errors and situations where no usable addresses
 are returned).

By introducing “tail” and “first_new” pointers, new entries can be appended
to an existing list and safely detached if memory allocation fails mid‐stream.

On top of that, a new helper API, ogs_sockaddr_from_ip_or_fqdn(), was added.

It automatically detects whether its input is a numeric IPv4/IPv6 literal
or a hostname (using AI_NUMERICHOST when appropriate), then delegates
resolution to ogs_addaddrinfo().

Errors are logged at the error level but do not trigger a fatal exit,
and any partial lists are cleaned up before returning.

Finally, the SMF configuration parser in context.c was updated to use
this new API for “p-cscf” entries, allowing both raw IP addresses
and DNS names in smf.yaml.

Corresponding adjustments were made in context.h (to change the p_cscf
and p_cscf6 arrays to mutable char pointers) and in the cleanup routine
smf_context_final() to free any dynamically allocated strings.

Together, these improvements eliminate duplicate parsing logic,
streamline configuration handling, and increase the overall resilience
of address resolution across Open5GS.
2025-07-21 16:44:45 +09:00
..
2024-09-03 22:09:56 +09:00
2019-10-27 17:41:14 +09:00
2019-10-27 17:41:14 +09:00
2020-09-18 19:39:02 -04:00
2019-10-27 17:41:14 +09:00
2021-02-08 14:25:40 -05:00
2019-10-27 17:41:14 +09:00
2019-10-27 17:41:14 +09:00
2020-11-12 20:58:08 -05:00
2020-11-12 20:58:08 -05:00
2023-04-04 21:53:39 +09:00
2020-11-12 20:58:08 -05:00
2020-11-12 20:58:08 -05:00
2019-10-27 17:41:14 +09:00
2019-10-27 17:41:14 +09:00
2025-05-31 20:51:41 +09:00
2020-11-12 20:58:08 -05:00
2019-10-27 17:41:14 +09:00
2019-10-27 17:41:14 +09:00
2020-11-09 22:57:14 -05:00
2020-11-12 20:58:08 -05:00
2019-10-27 17:41:14 +09:00
2019-10-27 17:41:14 +09:00
2019-10-27 17:41:14 +09:00
2022-09-25 16:42:46 +09:00
2022-06-29 14:35:01 +09:00
2023-10-28 22:11:58 +09:00
2022-09-25 16:42:46 +09:00
2020-11-12 20:58:08 -05:00