From 2be3cb89d6a2539341da434746ab153e6972c49a Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 17 Jun 2020 10:01:07 +0200 Subject: [PATCH] settings: fix assertion when updating default wired connection The connection is expected to have the NM_GENERATED flag, since it has a default wired device. Fixes: d35d3c468a30 ('settings: rework tracking settings connections and settings plugins') https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/471 (cherry picked from commit 4aefad567387cf11c460f77beeb9f05bd05e46c0) (cherry picked from commit 3951396de78b3280065ae2dc7fec845bf4d76289) (cherry picked from commit ac89b8f6b7211d354a3438d522408d9db94af0e4) (cherry picked from commit c92a8575385c30d21d94320954e4b3d7b1e64c0b) --- src/settings/nm-settings.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index b55021ca35..33aac0fe4a 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -2000,10 +2000,10 @@ nm_settings_update_connection (NMSettings *self, */ device = nm_settings_connection_default_wired_get_device (sett_conn); if (device) { + nm_assert (cur_in_memory); - nm_assert (!NM_FLAGS_ANY (nm_settings_connection_get_flags (sett_conn), - NM_SETTINGS_CONNECTION_INT_FLAGS_NM_GENERATED - | NM_SETTINGS_CONNECTION_INT_FLAGS_VOLATILE)); + nm_assert (NM_FLAGS_HAS (nm_settings_connection_get_flags (sett_conn), + NM_SETTINGS_CONNECTION_INT_FLAGS_NM_GENERATED)); default_wired_clear_tag (self, device, sett_conn, FALSE);