summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-05-20 14:55:04 +0200
committerThomas Haller <thaller@redhat.com>2015-05-29 11:33:17 +0200
commit3a1c947ea746dc7a7369cc17de1a21624070a989 (patch)
tree236d673d5c4b9d220316edba4e1a376585ce2bbb
parentb78b81c9cedb917a10b4ef45fc56550ac4818104 (diff)
downloadNetworkManager-th/default-dns-options-bgo749648.tar.gz
cli: show dns-options default valueth/default-dns-options-bgo749648
You can reset the default value via $ nmcli connection modify id CON ipv4.dns-options "" and set an empty value with $ nmcli connection modify id CON ipv4.dns-options " "
-rw-r--r--clients/cli/settings.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/clients/cli/settings.c b/clients/cli/settings.c
index b02da684db..cda7a7720c 100644
--- a/clients/cli/settings.c
+++ b/clients/cli/settings.c
@@ -1261,7 +1261,7 @@ DEFINE_GETTER (nmc_property_ib_get_parent, NM_SETTING_INFINIBAND_PARENT)
DEFINE_GETTER (nmc_property_ipv4_get_method, NM_SETTING_IP_CONFIG_METHOD)
DEFINE_GETTER (nmc_property_ipv4_get_dns, NM_SETTING_IP_CONFIG_DNS)
DEFINE_GETTER (nmc_property_ipv4_get_dns_search, NM_SETTING_IP_CONFIG_DNS_SEARCH)
-DEFINE_GETTER (nmc_property_ipv4_get_dns_options, NM_SETTING_IP_CONFIG_DNS_OPTIONS)
+DEFINE_GETTER_WITH_DEFAULT (nmc_property_ipv4_get_dns_options, NM_SETTING_IP_CONFIG_DNS_OPTIONS, !nm_setting_ip_config_has_dns_options ((NMSettingIPConfig *) setting))
static char *
nmc_property_ip_get_addresses (NMSetting *setting, NmcPropertyGetType get_type)
@@ -1359,7 +1359,7 @@ DEFINE_GETTER (nmc_property_ipv4_get_may_fail, NM_SETTING_IP_CONFIG_MAY_FAIL)
DEFINE_GETTER (nmc_property_ipv6_get_method, NM_SETTING_IP_CONFIG_METHOD)
DEFINE_GETTER (nmc_property_ipv6_get_dns, NM_SETTING_IP_CONFIG_DNS)
DEFINE_GETTER (nmc_property_ipv6_get_dns_search, NM_SETTING_IP_CONFIG_DNS_SEARCH)
-DEFINE_GETTER (nmc_property_ipv6_get_dns_options, NM_SETTING_IP_CONFIG_DNS_OPTIONS)
+DEFINE_GETTER_WITH_DEFAULT (nmc_property_ipv6_get_dns_options, NM_SETTING_IP_CONFIG_DNS_OPTIONS, !nm_setting_ip_config_has_dns_options ((NMSettingIPConfig *) setting))
static char *
nmc_property_ipv6_get_routes (NMSetting *setting, NmcPropertyGetType get_type)
@@ -3319,6 +3319,7 @@ nmc_property_ipv4_set_dns_options (NMSetting *setting, const char *prop, const c
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+ nm_setting_ip_config_clear_dns_options (NM_SETTING_IP_CONFIG (setting), TRUE);
strv = nmc_strsplit_set (val, " \t,", 0);
while (strv && strv[i])
nm_setting_ip_config_add_dns_option (NM_SETTING_IP_CONFIG (setting), strv[i++]);
@@ -3632,6 +3633,7 @@ nmc_property_ipv6_set_dns_options (NMSetting *setting, const char *prop, const c
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
+ nm_setting_ip_config_clear_dns_options (NM_SETTING_IP_CONFIG (setting), TRUE);
strv = nmc_strsplit_set (val, " \t,", 0);
while (strv && strv[i])
nm_setting_ip_config_add_dns_option (NM_SETTING_IP_CONFIG (setting), strv[i++]);