From 1158d019266aeeea1fd9c2a423b7855be4c6897f Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Fri, 13 Dec 2019 18:05:38 +0100 Subject: [PATCH] manager: create a virtual device only if the connection can autoconnect The autoconnection for virtual devices currently works in two phases. First we detect that there is suitable profile that can autoconnect and we realize the device. Then, when the device becomes 'disconnected', autoconnect kicks in and starts the activation. However, if autoconnect is blocked for a device, currently we do step 1 without step 2, leaving a stale interface around. Fix this by also checking that autoconnect is not blocked during step 1. https://bugzilla.redhat.com/show_bug.cgi?id=1765047 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/360 (cherry picked from commit 6c716912eb6ddcbf56feee1913bf9235deae20c0) (cherry picked from commit 944ff9f9dc923a95df5e4a09bbda9ce706df45e9) (cherry picked from commit cbb1ad1ba7499d1aad7b65dd225ef66577259627) (cherry picked from commit dc03a2649422ce15209c2a32634d7c1b52e29a76) --- src/nm-manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index 0bf6a75102..311c737370 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2004,7 +2004,8 @@ system_create_virtual_device (NMManager *self, NMConnection *connection) s_con = nm_connection_get_setting_connection (candidate); g_assert (s_con); - if (!nm_setting_connection_get_autoconnect (s_con)) + if ( !nm_setting_connection_get_autoconnect (s_con) + || nm_settings_connection_autoconnect_is_blocked (connections[i])) continue; /* Create any backing resources the device needs */