[network-manager-applet] editor: fix another crash when adding bridge/bond/team connection



commit 4ad891d7d1d21f57578fd1576e6bbc3fe18c7d8d
Author: Jiří Klimeš <jklimes redhat com>
Date:   Tue Mar 10 10:00:29 2015 +0100

    editor: fix another crash when adding bridge/bond/team connection
    
    Fixes commit 4d7546e7d0e56c3a102a12ba03695eac6f8109f8.

 src/connection-editor/page-bond.c   |    4 +++-
 src/connection-editor/page-bridge.c |    6 ++++--
 src/connection-editor/page-master.c |    2 +-
 src/connection-editor/page-team.c   |    4 +++-
 4 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/connection-editor/page-bond.c b/src/connection-editor/page-bond.c
index 588e747..ead80e9 100644
--- a/src/connection-editor/page-bond.c
+++ b/src/connection-editor/page-bond.c
@@ -603,6 +603,7 @@ bond_connection_new (GtkWindow *parent,
                      gpointer user_data)
 {
        NMConnection *connection;
+       NMSettingConnection *s_con;
        int bond_num = 0, num, i;
        const GPtrArray *connections;
        NMConnection *conn2;
@@ -632,8 +633,9 @@ bond_connection_new (GtkWindow *parent,
                        bond_num = num + 1;
        }
 
+       s_con = nm_connection_get_setting_connection (connection);
        my_iface = g_strdup_printf ("bond%d", bond_num);
-       g_object_set (G_OBJECT (connection),
+       g_object_set (G_OBJECT (s_con),
                      NM_SETTING_CONNECTION_INTERFACE_NAME, my_iface,
                      NULL);
        g_free (my_iface);
diff --git a/src/connection-editor/page-bridge.c b/src/connection-editor/page-bridge.c
index 9f2a3f0..ad6995c 100644
--- a/src/connection-editor/page-bridge.c
+++ b/src/connection-editor/page-bridge.c
@@ -299,6 +299,7 @@ bridge_connection_new (GtkWindow *parent,
                        gpointer user_data)
 {
        NMConnection *connection;
+       NMSettingConnection *s_con;
        int bridge_num = 0, num, i;
        const GPtrArray *connections;
        NMConnection *conn2;
@@ -319,7 +320,7 @@ bridge_connection_new (GtkWindow *parent,
 
                if (!nm_connection_is_type (conn2, NM_SETTING_BRIDGE_SETTING_NAME))
                        continue;
-               iface = nm_connection_get_interface_name (connection);
+               iface = nm_connection_get_interface_name (conn2);
                if (!iface || strncmp (iface, "bridge", 6) != 0 || !g_ascii_isdigit (iface[6]))
                        continue;
 
@@ -328,8 +329,9 @@ bridge_connection_new (GtkWindow *parent,
                        bridge_num = num + 1;
        }
 
+       s_con = nm_connection_get_setting_connection (connection);
        my_iface = g_strdup_printf ("bridge%d", bridge_num);
-       g_object_set (G_OBJECT (connection),
+       g_object_set (G_OBJECT (s_con),
                      NM_SETTING_CONNECTION_INTERFACE_NAME, my_iface,
                      NULL);
        g_free (my_iface);
diff --git a/src/connection-editor/page-master.c b/src/connection-editor/page-master.c
index abf6fb3..c229c59 100644
--- a/src/connection-editor/page-master.c
+++ b/src/connection-editor/page-master.c
@@ -295,7 +295,7 @@ connection_added (NMClient *client,
                return;
 
        interface_name = nm_connection_get_interface_name (CE_PAGE (self)->connection);
-       if (strcmp (master, interface_name) != 0 && strcmp (master, priv->uuid) != 0)
+       if (g_strcmp0 (master, interface_name) != 0 && g_strcmp0 (master, priv->uuid) != 0)
                return;
 
        check_new_slave_physical_port (self, NM_CONNECTION (connection));
diff --git a/src/connection-editor/page-team.c b/src/connection-editor/page-team.c
index bfb6c32..7438c3b 100644
--- a/src/connection-editor/page-team.c
+++ b/src/connection-editor/page-team.c
@@ -329,6 +329,7 @@ team_connection_new (GtkWindow *parent,
                      gpointer user_data)
 {
        NMConnection *connection;
+       NMSettingConnection *s_con;
        int team_num, num, i;
        const GPtrArray *connections;
        NMConnection *conn2;
@@ -359,8 +360,9 @@ team_connection_new (GtkWindow *parent,
                        team_num = num + 1;
        }
 
+       s_con = nm_connection_get_setting_connection (connection);
        my_iface = g_strdup_printf ("team%d", team_num);
-       g_object_set (G_OBJECT (connection),
+       g_object_set (G_OBJECT (s_con),
                      NM_SETTING_CONNECTION_INTERFACE_NAME, my_iface,
                      NULL);
        g_free (my_iface);


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