]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolvectl: show resolv.conf mode in resolvectl output 17203/head
authorLennart Poettering <lennart@poettering.net>
Tue, 29 Sep 2020 15:28:31 +0000 (17:28 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 30 Sep 2020 08:27:51 +0000 (10:27 +0200)
src/resolve/resolvectl.c

index 8378ff591c766360b8c01d89fd7317a95eb995b4..4581c2e3c8710fffdd453fb72326c63247cb7268 100644 (file)
@@ -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:",