summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2013-11-08 15:07:20 -0600
committerDan Williams <dcbw@redhat.com>2013-11-08 16:46:45 -0600
commitf4139112391794fd8f4bbf68988571065c96f443 (patch)
treea885a7f1a199ba15a9530744794d0106a0eead11
parent6b7ebc0eb9f31f55184f941715af79bc24d344af (diff)
downloadNetworkManager-f4139112391794fd8f4bbf68988571065c96f443.tar.gz
core: don't deactivate assumed connections when quitting
If an assumed bridge/bond/team/whatever happened to be in the process of activating (perhaps it had no recognized slaves and was waiting for them to continue with IP configuration) when NM quits, don't deactivate the device and blow away the assumed configuration.
-rw-r--r--src/nm-manager.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index cb4569e5ec..313b67bbad 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -796,18 +796,20 @@ remove_device (NMManager *manager, NMDevice *device, gboolean quitting)
NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
if (nm_device_get_managed (device)) {
- /* When quitting, we want to leave up interfaces & connections
- * that can be taken over again (ie, "assumed") when NM restarts
- * so that '/etc/init.d/NetworkManager restart' will not distrupt
- * networking for interfaces that support connection assumption.
- * All other devices get unmanaged when NM quits so that their
- * connections get torn down and the interface is deactivated.
+ /* Leave configured interfaces up when quitting so they can be
+ * taken over again if NM starts up, and to ensure connectivity while
+ * NM is gone. Assumed connections don't get taken down even if they
+ * haven't been fully activated.
*/
if ( !nm_device_can_assume_connections (device)
|| (nm_device_get_state (device) != NM_DEVICE_STATE_ACTIVATED)
- || !quitting)
- nm_device_set_manager_managed (device, FALSE, NM_DEVICE_STATE_REASON_REMOVED);
+ || !quitting) {
+ NMActRequest *req = nm_device_get_act_request (device);
+
+ if (!req || !nm_active_connection_get_assumed (NM_ACTIVE_CONNECTION (req)))
+ nm_device_set_manager_managed (device, FALSE, NM_DEVICE_STATE_REASON_REMOVED);
+ }
}
g_signal_handlers_disconnect_matched (device, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, manager);