From 8a67713e9e02887d7d83edd63c173d16d8b5b59f Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 24 Feb 2014 09:33:48 +0100 Subject: [PATCH] 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 --- cli/src/settings.c | 8 ++++++-- 1 file 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);