From 490117633cc16f30c81d267ab9ebef6fb67d9d4c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Mon, 24 Sep 2007 21:50:11 +0000 Subject: [PATCH] 2007-09-24 Dan Williams * src/NetworkManagerPolicy.c - (nm_policy_auto_get_best_device): don't interrupt activation of a device by deactivating it because it doesn't have a "best connection". Since autoconnect=False connections aren't automatically chosen, NM would interrupt activation of such a connection because it would never be "best" due to autoconnect=False. git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2867 4912f4e0-d625-0410-9fb7-b9a5a253dbdc --- ChangeLog | 9 +++++++++ src/NetworkManagerPolicy.c | 19 ++++++++++++++----- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7ad3dda38..0a734e0101 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-09-24 Dan Williams + + * src/NetworkManagerPolicy.c + - (nm_policy_auto_get_best_device): don't interrupt activation of a + device by deactivating it because it doesn't have a "best connection". + Since autoconnect=False connections aren't automatically chosen, + NM would interrupt activation of such a connection because it + would never be "best" due to autoconnect=False. + 2007-09-24 Dan Williams * src/nm-manager.c diff --git a/src/NetworkManagerPolicy.c b/src/NetworkManagerPolicy.c index dc2637b03f..36bfa16c51 100644 --- a/src/NetworkManagerPolicy.c +++ b/src/NetworkManagerPolicy.c @@ -99,8 +99,18 @@ nm_policy_auto_get_best_device (NMPolicy *policy, caps = nm_device_get_capabilities (dev); tmp_con = nm_device_get_best_connection (dev, &tmp_obj); - if (tmp_con == NULL) - continue; + if (tmp_con == NULL) { + NMActRequest *req = nm_device_get_act_request (dev); + + /* If the device is activating, the NMConnection it's got is the + * best one. In other words, follow activation of a particular + * NMConnection through to success/failure rather than cutting it + * off if it becomes invalid + */ + tmp_con = req ? nm_act_request_get_connection (req) : NULL; + if (!tmp_con) + continue; + } if (NM_IS_DEVICE_802_3_ETHERNET (dev)) { if (link_active) @@ -115,9 +125,8 @@ nm_policy_auto_get_best_device (NMPolicy *policy, best_wired_connection = tmp_con; best_wired_specific_object = tmp_obj; } - } - else if (NM_IS_DEVICE_802_11_WIRELESS (dev) && - nm_manager_wireless_enabled (policy->manager)) { + } else if ( NM_IS_DEVICE_802_11_WIRELESS (dev) + && nm_manager_wireless_enabled (policy->manager)) { /* Bump by 1 so that _something_ gets chosen every time */ prio += 1;