]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
dns-configuration: dispatch resolv conf mode to DNSConfiguration
authorNick Rosbrook <enr0n@ubuntu.com>
Fri, 30 Jan 2026 19:34:22 +0000 (14:34 -0500)
committerNick Rosbrook <enr0n@ubuntu.com>
Tue, 3 Feb 2026 20:07:41 +0000 (15:07 -0500)
This is one of several commits to dispatch all fields of the
DNSConfiguration JSON.

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

index 2fa9d10f885d9b961b8e03c897bcd68b6c838422..16301d585f039727f22d906f90f5844d07807bd6 100644 (file)
@@ -164,6 +164,7 @@ DNSConfiguration* dns_configuration_free(DNSConfiguration *c) {
         free(c->dns_over_tls_mode_str);
         free(c->llmnr_mode_str);
         free(c->mdns_mode_str);
+        free(c->resolv_conf_mode_str);
         strv_free(c->negative_trust_anchors);
 
         return mfree(c);
@@ -191,10 +192,10 @@ static int dispatch_dns_configuration(const char *name, sd_json_variant *variant
                 { "mDNS",                 SD_JSON_VARIANT_STRING,        sd_json_dispatch_string,      offsetof(DNSConfiguration, mdns_mode_str),          0             },
                 { "fallbackServers",      SD_JSON_VARIANT_ARRAY,         dispatch_dns_server_array,    offsetof(DNSConfiguration, fallback_dns_servers),   0             },
                 { "negativeTrustAnchors", SD_JSON_VARIANT_ARRAY,         sd_json_dispatch_strv,        offsetof(DNSConfiguration, negative_trust_anchors), 0             },
+                { "resolvConfMode",       SD_JSON_VARIANT_STRING,        sd_json_dispatch_string,      offsetof(DNSConfiguration, resolv_conf_mode_str),   0             },
 
                 /* The remaining fields are currently unused by wait-online. */
                 { "delegate",             _SD_JSON_VARIANT_TYPE_INVALID, NULL,                         0,                                              0             },
-                { "resolvConfMode",       _SD_JSON_VARIANT_TYPE_INVALID, NULL,                         0,                                              0             },
                 { "scopes",               _SD_JSON_VARIANT_TYPE_INVALID, NULL,                         0,                                              0             },
                 {},
 
index 0b337c58b204380b7208dda437ded7d3d5b2f8a2..53192ad5968f32d675401c87898c24c61173562d 100644 (file)
@@ -39,6 +39,7 @@ typedef struct DNSConfiguration {
         char *llmnr_mode_str;
         char *mdns_mode_str;
         char **negative_trust_anchors;
+        char *resolv_conf_mode_str;
 } DNSConfiguration;
 
 DNSConfiguration* dns_configuration_free(DNSConfiguration *c);