From: Lennart Poettering Date: Tue, 29 Sep 2020 15:28:31 +0000 (+0200) Subject: resolvectl: show resolv.conf mode in resolvectl output X-Git-Tag: v247-rc1~144^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=147a5046aadc2909647be32194c65d67eb42d9ce;p=thirdparty%2Fsystemd.git resolvectl: show resolv.conf mode in resolvectl output --- diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index 8378ff591c7..4581c2e3c87 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -1662,6 +1662,7 @@ struct global_info { const char *mdns; const char *dns_over_tls; const char *dnssec; + const char *resolv_conf_mode; bool dnssec_supported; }; @@ -1691,6 +1692,7 @@ static int status_global(sd_bus *bus, StatusMode mode, bool *empty_line) { { "DNSOverTLS", "s", NULL, offsetof(struct global_info, dns_over_tls) }, { "DNSSEC", "s", NULL, offsetof(struct global_info, dnssec) }, { "DNSSECSupported", "b", NULL, offsetof(struct global_info, dnssec_supported) }, + { "ResolvConfMode", "s", NULL, offsetof(struct global_info, resolv_conf_mode) }, {} }; _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; @@ -1775,6 +1777,14 @@ static int status_global(sd_bus *bus, StatusMode mode, bool *empty_line) { if (r < 0) return table_log_add_error(r); + if (global_info.resolv_conf_mode) { + r = table_add_many(table, + TABLE_STRING, "resolv.conf mode:", + TABLE_STRING, global_info.resolv_conf_mode); + if (r < 0) + return table_log_add_error(r); + } + if (global_info.current_dns) { r = table_add_many(table, TABLE_STRING, "Current DNS Server:",