summaryrefslogtreecommitdiff
path: root/cli
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2014-02-24 09:33:48 +0100
committerThomas Haller <thaller@redhat.com>2014-02-24 09:44:29 +0100
commit8a67713e9e02887d7d83edd63c173d16d8b5b59f (patch)
tree323c5f95408f20b5b65ba1ad3fd8e63032d08186 /cli
parent93e4e0f8a1e911d5c8e6023330512a5266cc089f (diff)
downloadNetworkManager-8a67713e9e02887d7d83edd63c173d16d8b5b59f.tar.gz
cli: allow resetting the connection.master to NULL
Without this patch, the following two commands fail: nmcli connection modify em1 connection.master nmcli connection modify em1 connection.master "" Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/settings.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/cli/src/settings.c b/cli/src/settings.c
index 376d7026df..10392b6b00 100644
--- a/cli/src/settings.c
+++ b/cli/src/settings.c
@@ -2372,8 +2372,12 @@ nmc_property_con_set_master (NMSetting *setting, const char *prop, const char *v
{
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
- if ( !nm_utils_iface_valid_name (val)
- && !nm_utils_is_uuid (val)) {
+ if (!val)
+ ;
+ else if (!*val)
+ val = NULL;
+ else if ( !nm_utils_iface_valid_name (val)
+ && !nm_utils_is_uuid (val)) {
g_set_error (error, 1, 0,
_("'%s' is not valid master; use ifname or connection UUID"),
val);