mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 04:50:11 +01:00
clients: remove the same dns-option before adding it
nmcli connection modify t ipv4.dns-options ndots:2
nmcli connection modify t +ipv4.dns-options ndots:4
should set dns-options to 'ndots:4', so we must remove other
occurences of the same option before adding it, otherwise the setting
refuses to set the same option again.
(cherry picked from commit b11a20ded0)
This commit is contained in:
parent
2bd646f333
commit
d5700563cb
1 changed files with 6 additions and 2 deletions
|
|
@ -3391,14 +3391,18 @@ static gboolean
|
|||
_set_fcn_ip_config_dns_options (ARGS_SET_FCN)
|
||||
{
|
||||
gs_free const char **strv = NULL;
|
||||
NMSettingIPConfig *s_ip;
|
||||
gsize i;
|
||||
|
||||
nm_assert (!error || !*error);
|
||||
s_ip = NM_SETTING_IP_CONFIG (setting);
|
||||
|
||||
strv = nm_utils_strsplit_set (value, " \t,", FALSE);
|
||||
if (strv) {
|
||||
for (i = 0; strv[i]; i++)
|
||||
nm_setting_ip_config_add_dns_option (NM_SETTING_IP_CONFIG (setting), strv[i]);
|
||||
for (i = 0; strv[i]; i++) {
|
||||
nm_setting_ip_config_remove_dns_option_by_value (s_ip, strv[i]);
|
||||
nm_setting_ip_config_add_dns_option (s_ip, strv[i]);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue