From: Yu Watanabe Date: Fri, 11 Oct 2024 18:23:04 +0000 (+0900) Subject: in-addr-util: rename in_addr_prefix_from_string_auto_internal() -> _full() X-Git-Tag: v257-rc1~249^2~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1316cd00d73e2a2ec8e9f84512edabd6b970cfa;p=thirdparty%2Fsystemd.git in-addr-util: rename in_addr_prefix_from_string_auto_internal() -> _full() The function is also used in other source files. Hence, not internal. No functional change, just refactoring. --- diff --git a/src/basic/in-addr-util.c b/src/basic/in-addr-util.c index c077f0aa7db..fa28d79dcbe 100644 --- a/src/basic/in-addr-util.c +++ b/src/basic/in-addr-util.c @@ -890,7 +890,7 @@ int in_addr_prefix_from_string( return 0; } -int in_addr_prefix_from_string_auto_internal( +int in_addr_prefix_from_string_auto_full( const char *p, InAddrPrefixLenMode mode, int *ret_family, diff --git a/src/basic/in-addr-util.h b/src/basic/in-addr-util.h index 9cd0aca9a4e..2efe9aec01c 100644 --- a/src/basic/in-addr-util.h +++ b/src/basic/in-addr-util.h @@ -181,9 +181,9 @@ typedef enum InAddrPrefixLenMode { PREFIXLEN_REFUSE, /* Fail with -ENOANO if prefixlen is not specified. */ } InAddrPrefixLenMode; -int in_addr_prefix_from_string_auto_internal(const char *p, InAddrPrefixLenMode mode, int *ret_family, union in_addr_union *ret_prefix, unsigned char *ret_prefixlen); +int in_addr_prefix_from_string_auto_full(const char *p, InAddrPrefixLenMode mode, int *ret_family, union in_addr_union *ret_prefix, unsigned char *ret_prefixlen); static inline int in_addr_prefix_from_string_auto(const char *p, int *ret_family, union in_addr_union *ret_prefix, unsigned char *ret_prefixlen) { - return in_addr_prefix_from_string_auto_internal(p, PREFIXLEN_FULL, ret_family, ret_prefix, ret_prefixlen); + return in_addr_prefix_from_string_auto_full(p, PREFIXLEN_FULL, ret_family, ret_prefix, ret_prefixlen); } static inline size_t FAMILY_ADDRESS_SIZE(int family) { diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index 7807d83c5a7..aaa9d16fe35 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -2089,7 +2089,7 @@ static int config_parse_address( assert(rvalue); /* Address=address/prefixlen */ - r = in_addr_prefix_from_string_auto_internal(rvalue, PREFIXLEN_REFUSE, &f, &buffer, &prefixlen); + r = in_addr_prefix_from_string_auto_full(rvalue, PREFIXLEN_REFUSE, &f, &buffer, &prefixlen); if (r == -ENOANO) { r = in_addr_prefix_from_string_auto(rvalue, &f, &buffer, &prefixlen); if (r >= 0) diff --git a/src/test/test-in-addr-util.c b/src/test/test-in-addr-util.c index fcc9a0a72d4..769cb8f083b 100644 --- a/src/test/test-in-addr-util.c +++ b/src/test/test-in-addr-util.c @@ -36,7 +36,7 @@ static void test_in_addr_prefix_from_string_one( assert_se(in_addr_equal(family, &q, u)); assert_se(l == prefixlen); - r = in_addr_prefix_from_string_auto_internal(p, PREFIXLEN_REFUSE, &f, &q, &l); + r = in_addr_prefix_from_string_auto_full(p, PREFIXLEN_REFUSE, &f, &q, &l); assert_se(r == ret_refuse); if (r >= 0) {