summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2013-12-04 15:58:32 +0100
committerJiří Klimeš <jklimes@redhat.com>2013-12-04 16:06:08 +0100
commit41d3efbd7363de70de0499e325ad80105a5aeea7 (patch)
tree556c3a64a999890cbe347d691cbec9340522091f
parentd0c2a24b7140e15ba2722f24fbad22a6d94dbab0 (diff)
downloadNetworkManager-41d3efbd7363de70de0499e325ad80105a5aeea7.tar.gz
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).
-rw-r--r--src/nm-manager.c11
1 files 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);