[network-manager-applet] editor: do not add new IP config settings if they are already present



commit bc8a79526ac5c3361f6fc0df272df8ad6d8f6738
Author: Jiří Klimeš <jklimes redhat com>
Date:   Thu Nov 19 13:01:22 2015 +0100

    editor: do not add new IP config settings if they are already present
    
    This would erase existing IP config data. There can be an existing IP setting
    in the connection, for example when importing VPN connections.
    
    Fixes: f06b8e3f972c76cb48437d384622cbb2f8ee8584

 src/connection-editor/nm-connection-list.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/connection-editor/nm-connection-list.c b/src/connection-editor/nm-connection-list.c
index e28da67..1c912ad 100644
--- a/src/connection-editor/nm-connection-list.c
+++ b/src/connection-editor/nm-connection-list.c
@@ -279,9 +279,9 @@ really_add_connection (NMConnection *connection,
                return;
        }
 
-       if (connection_supports_ip4 (connection))
+       if (connection_supports_ip4 (connection) && !nm_connection_get_setting_ip4_config (connection))
                nm_connection_add_setting (connection, nm_setting_ip4_config_new ());
-       if (connection_supports_ip6 (connection))
+       if (connection_supports_ip6 (connection) && !nm_connection_get_setting_ip6_config (connection))
                nm_connection_add_setting (connection, nm_setting_ip6_config_new ());
 
        editor = nm_connection_editor_new (GTK_WINDOW (list->dialog), connection, list->client);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]