summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2016-09-28 22:39:09 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2016-10-04 14:30:01 +0200
commit11e3c88295a84aaeeb63b2be461f40faad41dfc8 (patch)
tree894a8842b670c0858771d3aadf95f19c0a573412
parent7bf10b4ccad904c05187a4cae21c0de109a0de4c (diff)
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)
-rw-r--r--clients/cli/connections.c6
1 files 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);
}