From 336bfcabc4f5563799bf0f52cfa17ce2425ea375 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Mon, 27 Jan 2020 18:38:00 +0100 Subject: [PATCH] manager: skip activation of a virtual device if master is missing Don't realize a virtual device if the master is missing because in such case the autoactivation can't start and a stale link will be created. --- src/nm-manager.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/nm-manager.c b/src/nm-manager.c index 1b00b1d320..71a665494e 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2011,6 +2011,20 @@ system_create_virtual_device (NMManager *self, NMConnection *connection) return device; } + if (!find_master (self, + connection, + device, + NULL, + NULL, + NULL, + &error)) { + _LOG3D (LOGD_DEVICE, connection, + "skip activation: %s", + error->message); + g_error_free (error); + return device; + } + /* Create backing resources if the device has any autoconnect connections */ connections = nm_settings_get_connections_clone (priv->settings, NULL, NULL, NULL,