summary refs log tree commit diff
path: root/src/nmcli
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2022-02-24 19:33:43 +0100
committerMichael Biebl <biebl@debian.org>2022-02-24 19:33:43 +0100
commit4e966a21b9ef4fb910a5bd1a5699d404a65cfe55 (patch)
treea6fd45f9fe8a937bc3ce766e94b724822da6fc15 /src/nmcli
parente3f2ee969d065d2971170563c8aef77d5a0d39b9 (diff)
New upstream version 1.36.0 upstream/1.36.0
Diffstat (limited to 'src/nmcli')
-rw-r--r--src/nmcli/connections.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/nmcli/connections.c b/src/nmcli/connections.c
index 5a66b82f..559dc7db 100644
--- a/src/nmcli/connections.c
+++ b/src/nmcli/connections.c
@@ -4189,6 +4189,7 @@ set_option(NmCli                    *nmc,
            NMConnection             *connection,
            const NMMetaAbstractInfo *abstract_info,
            const char               *value,
+           gboolean                  allow_reset,
            GError                  **error)
 {
     const char            *setting_name, *property_name, *option_name;
@@ -4209,7 +4210,7 @@ set_option(NmCli                    *nmc,
                        NULL);
     if (option && option->check_and_set) {
         return option->check_and_set(nmc, connection, option, value, error);
-    } else {
+    } else if (value || allow_reset) {
         set_property(nmc->client,
                      connection,
                      setting_name,
@@ -5199,7 +5200,7 @@ nmc_process_connection_properties(NmCli              *nmc,
         if (!*argc && nmc->complete)
             complete_option(nmc, chosen, value ?: "", connection);
 
-        if (!set_option(nmc, connection, chosen, value, error))
+        if (!set_option(nmc, connection, chosen, value, TRUE, error))
             return FALSE;
 
     } while (*argc);
@@ -5410,7 +5411,7 @@ again:
     if (multi && !value)
         return;
 
-    if (!set_option(nmc, connection, abstract_info, value, &error)) {
+    if (!set_option(nmc, connection, abstract_info, value, FALSE, &error)) {
         g_printerr("%s\n", error->message);
         g_clear_error(&error);
         goto again;