cli: properly set multiple addresses in questionnaire mode

Pass the '+' modifier to set_property() for IPv4 and IPv6 addresses to
append the new address to existing ones instead of overwriting them.

Fixes: 2f45665559

https://bugzilla.redhat.com/show_bug.cgi?id=1380165
(cherry picked from commit 984d4f0684)
This commit is contained in:
Beniamino Galvani 2016-09-28 22:39:09 +02:00
parent 7bf10b4cca
commit 11e3c88295

View file

@ -4149,7 +4149,8 @@ set_ip4_address (NmCli *nmc, NMConnection *con, OptionInfo *option, const char *
NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_MANUAL,
NULL);
}
return set_property (con, option->setting_name, option->property, value, '\0', error);
return set_property (con, option->setting_name, option->property, value,
option->flags & OPTION_MULTI ? '+' : '\0', error);
}
static gboolean
@ -4168,7 +4169,8 @@ set_ip6_address (NmCli *nmc, NMConnection *con, OptionInfo *option, const char *
NM_SETTING_IP_CONFIG_METHOD, NM_SETTING_IP6_CONFIG_METHOD_MANUAL,
NULL);
}
return set_property (con, option->setting_name, option->property, value, '\0', error);
return set_property (con, option->setting_name, option->property, value,
option->flags & OPTION_MULTI ? '+' : '\0', error);
}