dns: don't print empty configurations

Previously we printed the DNS configuration for all devices including
unmanaged and unconfigured ones:

  dns-mgr: config:      100 best    v4 ens3             : 192.168.10.1
  dns-mgr: config:      100 default v6 ens3             : fd01🔡:3681:c4ff:fec0:fe94
  dns-mgr: config:      100 default v4 lo               :
  dns-mgr: config:      100 default v6 lo               :
  dns-mgr: config:      100 default v4 ens9             :
  dns-mgr: config:      100 default v6 ens9             :

Instead, print only devices that have name servers set.
This commit is contained in:
Beniamino Galvani 2016-10-24 22:33:59 +02:00
parent 8c4e824997
commit 5307e07e3b

View file

@ -1044,13 +1044,16 @@ update_dns (NMDnsManager *self,
prev_prio = prio;
_LOGT ("config: %8d %-7s v%c %-16s %s: %s",
prio,
_config_type_to_string (current->type),
v4 ? '4' : '6',
current->iface,
skip ? "<SKIP>" : "",
get_nameserver_list (current->config, &tmp_gstring));
if ( ( v4 && nm_ip4_config_get_num_nameservers ((NMIP4Config *) current->config))
|| (!v4 && nm_ip6_config_get_num_nameservers ((NMIP6Config *) current->config))) {
_LOGT ("config: %8d %-7s v%c %-16s %s: %s",
prio,
_config_type_to_string (current->type),
v4 ? '4' : '6',
current->iface,
skip ? "<SKIP>" : "",
get_nameserver_list (current->config, &tmp_gstring));
}
if (!skip) {
merge_one_ip_config_data (self, &rc, current);