]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dns-configuration: make dns_scope_free() static
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 6 Jul 2026 14:38:01 +0000 (23:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 10 Jul 2026 07:29:53 +0000 (16:29 +0900)
systemd-resolved already has a dns_scope_free() function in
resolved-dns-scope.c for DnsScope. Since the one in dns-configuration.c
is only used internally, make it static.

This is necessary to allow systemd-resolved to be statically linked
with libsystemd-shared without symbol conflicts.

src/shared/dns-configuration.c
src/shared/dns-configuration.h

index 01b59bbd892b9f13b8f029f2b4a5cceed0b7d406..0ef08667b054f3724a83afc194f138d75c870d49 100644 (file)
@@ -155,7 +155,7 @@ static int dispatch_search_domain_array(const char *name, sd_json_variant *varia
         return 0;
 }
 
-DNSScope* dns_scope_free(DNSScope *s) {
+static DNSScope* dns_scope_free(DNSScope *s) {
         if (!s)
                 return NULL;
 
@@ -167,6 +167,8 @@ DNSScope* dns_scope_free(DNSScope *s) {
         return mfree(s);
 }
 
+DEFINE_TRIVIAL_CLEANUP_FUNC(DNSScope*, dns_scope_free);
+
 DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(
         dns_scope_hash_ops,
         void,
index 40f0a4ad169376c3a916bca029bf0dd7a24de161..a14490f7e5a5a1e61f524941f854f20f8729ecf9 100644 (file)
@@ -25,6 +25,9 @@ typedef struct SearchDomain {
         int ifindex;
 } SearchDomain;
 
+SearchDomain* search_domain_free(SearchDomain *d);
+DEFINE_TRIVIAL_CLEANUP_FUNC(SearchDomain*, search_domain_free);
+
 typedef struct DNSScope {
         char *ifname;
         int ifindex;
@@ -34,12 +37,6 @@ typedef struct DNSScope {
         char *dns_over_tls_mode_str;
 } DNSScope;
 
-DNSScope* dns_scope_free(DNSScope *s);
-DEFINE_TRIVIAL_CLEANUP_FUNC(DNSScope*, dns_scope_free);
-
-SearchDomain* search_domain_free(SearchDomain *d);
-DEFINE_TRIVIAL_CLEANUP_FUNC(SearchDomain*, search_domain_free);
-
 typedef struct DNSConfiguration {
         char *ifname;
         int ifindex;