From dc3d072b04ecc58a78b097ef1e8bc36c843ac30a Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 10 Oct 2007 20:45:15 +0000 Subject: [PATCH] 2007-10-10 Dan Williams * src/nm-manager.c - (wait_for_connection_expired): ensure info is valid - (connection_added_default_handler): Should only remove pending connection info when the manager has the connection that it's waiting for. Fixes segfault in wait_for_connection_info(). git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2969 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 8 ++++++++ src/nm-manager.c | 12 +++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index be1aa14634..27be104323 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-10-10 Dan Williams + + * src/nm-manager.c + - (wait_for_connection_expired): ensure info is valid + - (connection_added_default_handler): Should only remove pending + connection info when the manager has the connection that it's + waiting for. Fixes segfault in wait_for_connection_info(). + 2007-10-10 Dan Williams * libnm-util/nm-setting.c diff --git a/src/nm-manager.c b/src/nm-manager.c index f2e0016131..7f7fede333 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1105,6 +1105,8 @@ wait_for_connection_expired (gpointer data) PendingConnectionInfo *info = priv->pending_connection_info; GError *err; + g_return_val_if_fail (info != NULL, FALSE); + nm_info ("%s: didn't receive connection details soon enough for activation.", nm_device_get_iface (info->device)); @@ -1158,15 +1160,12 @@ connection_added_default_handler (NMManager *manager, NMConnectionType connection_type) { NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager); - PendingConnectionInfo *info; + PendingConnectionInfo *info = priv->pending_connection_info; const char *path; - if (!nm_manager_activation_pending (manager)) + if (!info) return; - info = priv->pending_connection_info; - priv->pending_connection_info = NULL; - if (connection_type != info->connection_type) return; @@ -1174,6 +1173,9 @@ connection_added_default_handler (NMManager *manager, if (strcmp (info->connection_path, path)) return; + /* Will destroy below; can't be valid during the initial activation start */ + priv->pending_connection_info = NULL; + // FIXME: remove old_dev deactivation when multiple device support lands deactivate_old_device (manager);