From 11e3c88295a84aaeeb63b2be461f40faad41dfc8 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 28 Sep 2016 22:39:09 +0200 Subject: [PATCH] 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: 2f456655593e92385a7e736691e7691514740805 https://bugzilla.redhat.com/show_bug.cgi?id=1380165 (cherry picked from commit 984d4f068456390352ab16416a55e835027ba66e) --- clients/cli/connections.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clients/cli/connections.c b/clients/cli/connections.c index dfd619cc20..fe367a3f4a 100644 --- a/clients/cli/connections.c +++ b/clients/cli/connections.c @@ -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); }