]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: include current DNS server in JSON again
authorNick Rosbrook <enr0n@ubuntu.com>
Mon, 19 Jan 2026 18:29:52 +0000 (13:29 -0500)
committerNick Rosbrook <enr0n@ubuntu.com>
Mon, 19 Jan 2026 18:29:52 +0000 (13:29 -0500)
The current_dns_server_json object in dns_configuration_json_append() is
always NULL, because the logic to dump the current DNS server to JSON
was removed by mistake in a re-factoring commit. Add that logic back.

Fixes c6b6ac63ea ("resolve: drop unnecessary preparation of empty arrays").

src/resolve/resolved-manager.c

index df0b2213bef3929c887d3ad4b262c29745b9c63e..95e635d852777f662a65f9ad1be3e77c106eb33d 100644 (file)
@@ -2071,6 +2071,12 @@ static int dns_configuration_json_append(
 
         assert(configuration);
 
+        if (current_dns_server) {
+                r = dns_server_dump_configuration_to_json(current_dns_server, &current_dns_server_json);
+                if (r < 0)
+                        return r;
+        }
+
         SET_FOREACH(scope, dns_scopes) {
                 _cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL;