From 41d3efbd7363de70de0499e325ad80105a5aeea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Klime=C5=A1?= Date: Wed, 4 Dec 2013 15:58:32 +0100 Subject: [PATCH] manager: do not create software devices when device was manually disconnected We can only create virtual interfaces when the connection has autoconnect property *and* the device was not manually disconnected before. Without this commit NetworkManager would auto-activate all virtual connections when a change was done (e.g. new virtual connection was addded). --- src/nm-manager.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 77b042c2a0..3c55aed28b 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -1219,9 +1219,16 @@ system_create_virtual_devices (NMManager *self) g_assert (s_con); if (connection_needs_virtual_device (connection)) { - /* We only create a virtual interface if the connection can autoconnect */ - if (nm_setting_connection_get_autoconnect (s_con)) + char *iface = get_virtual_iface_name (self, connection, NULL); + + /* We only create a virtual interface if the connection can autoconnect + * and the interface was not manually disconnected before. + */ + if ( nm_setting_connection_get_autoconnect (s_con) + && iface + && nm_manager_can_device_auto_connect (self, iface)) system_create_virtual_device (self, connection); + g_free (iface); } } g_slist_free (connections);