From f4139112391794fd8f4bbf68988571065c96f443 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 8 Nov 2013 15:07:20 -0600 Subject: 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. --- src/nm-manager.c | 18 ++++++++++-------- 1 file 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); -- cgit v1.2.1