summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-11-12 14:18:44 -0500
committerDan Winship <danw@gnome.org>2013-11-13 13:35:41 -0500
commit3c236c88ebe396cff6ca492f1cc1cf1c30ed0e8c (patch)
tree0f8e6cbf6c1e4155591996b7375a52a0fa2c3526
parent49983db85eb0c4737271b27e83e70c1216419096 (diff)
downloadNetworkManager-3c236c88ebe396cff6ca492f1cc1cf1c30ed0e8c.tar.gz
core: fix re-activation of existing active connection
The change to allow an NMConnection to only be active on a single device accidentally broke the case of re-activating a connection on the same device. Fix that.
-rw-r--r--src/nm-manager.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 7555930d7a..039a6067e6 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -2894,20 +2894,23 @@ _new_active_connection (NMManager *self,
/* Can't create new AC for already-active connection */
existing_ac = find_ac_for_connection (self, connection);
+ if (NM_IS_VPN_CONNECTION (existing_ac)) {
+ g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_CONNECTION_ALREADY_ACTIVE,
+ "Connection '%s' is already active",
+ nm_connection_get_id (connection));
+ return NULL;
+ }
+
if (existing_ac) {
NMDevice *existing_device = nm_active_connection_get_device (existing_ac);
- if (NM_IS_VPN_CONNECTION (existing_ac) || existing_device == device) {
- g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_CONNECTION_ALREADY_ACTIVE,
- "Connection '%s' is already active",
- nm_connection_get_id (connection));
- } else {
+ if (existing_device != device) {
g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_CONNECTION_ALREADY_ACTIVE,
"Connection '%s' is already active on %s",
nm_connection_get_id (connection),
nm_device_get_iface (existing_device));
+ return NULL;
}
- return NULL;
}
/* Normalize the specific object */