diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2019-04-23 15:30:53 +0200 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2019-05-07 09:46:05 +0200 |
commit | da8462df1a273cd6b31f885b866726a64ca14550 (patch) | |
tree | f5dc07b3c5a343bc20f5f818fc8f31bbbb6871d0 | |
parent | bb555ff6b5959767ab663d610cdabb8baa280447 (diff) | |
download | NetworkManager-da8462df1a273cd6b31f885b866726a64ca14550.tar.gz |
manager: unmanage software devices when networking gets disabled
If a user disables networking, we consider that as an indication that
also software devices must be disconnected. OTOH, we don't want to
destroy them for external events as a system suspend.
(cherry picked from commit 32ee51eee002f5e6717b856fd0a095114a02cc96)
-rw-r--r-- | src/nm-manager.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c index ed2fa3df4e..c0cd15c0cd 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -5866,9 +5866,15 @@ do_sleep_wake (NMManager *self, gboolean sleeping_changed) * suspend/resume? */ c_list_for_each_entry (device, &priv->devices_lst_head, devices_lst) { - /* FIXME: shouldn't we be unmanaging software devices if !suspending? */ - if (nm_device_is_software (device)) - continue; + if (nm_device_is_software (device)) { + /* If a user disables networking we consider that as an + * indication that also software devices must be disconnected. + * But we don't want to destroy them for external events as + * a system suspend. + */ + if (suspending) + continue; + } /* Wake-on-LAN devices will be taken down post-suspend rather than pre- */ if ( suspending && device_is_wake_on_lan (priv->platform, device)) { |