From f8a20d0a092664e38022c82ee6ec77c4c25dbca5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 20 Jun 2019 09:07:45 +0200 Subject: [PATCH] manager: don't consider by-user change flag for creating unrealized device This effectively reverts commit [1]. The by-user argument is not very clear what it means. Is a "nmcli connection load $FILENAME" a user-action? How about reload? I don't know whether the problem that this was supposed to fix is still present. But in any case, the condition here seems not right. It's already hard to understand when and how we generate unrealized devices. If the condition from commit [1] should be prevented, then it must happen somehow differently. In the example, the offending connection is a generated volatile profile with the device being sys-face-state "external". Of course, we should not generate devices for such profiles nor autoactivating them. So adding a device for a volatile connection is always wrong. Don't do that, which should avoid the original problem. [1] commit a8a4eb14183b ('manager: don't create the virtual devices on all connection changes') --- src/nm-manager.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/nm-manager.c b/src/nm-manager.c index d653dc174a..c961ebc045 100644 --- a/src/nm-manager.c +++ b/src/nm-manager.c @@ -2064,8 +2064,14 @@ static void connection_changed (NMManager *self, NMSettingsConnection *sett_conn) { + NMConnection *connection; NMDevice *device; - NMConnection *connection = nm_settings_connection_get_connection (sett_conn); + + if (NM_FLAGS_HAS (nm_settings_connection_get_flags (sett_conn), + NM_SETTINGS_CONNECTION_INT_FLAGS_VOLATILE)) + return; + + connection = nm_settings_connection_get_connection (sett_conn); if (!nm_connection_is_virtual (connection)) return; @@ -2094,8 +2100,7 @@ connection_updated_cb (NMSettings *settings, gboolean by_user, NMManager *self) { - if (by_user) - connection_changed (self, sett_conn); + connection_changed (self, sett_conn); } /*****************************************************************************/