1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-29 06:50:16 +03:00

resolvectl: show resolv.conf mode in resolvectl output

This commit is contained in:
Lennart Poettering 2020-09-29 17:28:31 +02:00
parent 4261ab654c
commit 147a5046aa

View 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:",