From 971dcc0777d98fc8af0adb1bb17411cf0b8bee45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Sun, 25 Apr 2021 11:18:48 +0200 Subject: [PATCH] iwd: Actually update iwd config in mirror_connection() if needed There are cases where the settings didn't actually change and we just want to ensure NM and iwd settings are in sync (one such case would be when a setting was changed while iwd wasn't running, here we want to synchronize all settings when starting up iwd). We're already doing this and calling sett_conn_changed() from mirror_connection() on all connections after adding an interface, the actual settings synchronization code doesn't get executed though because we're passing 0 as update_reason, which means we bail out early from sett_conn_changed(). To make sure we actually update the iwd network configurations in that case, too, pass UPDATE_REASON_UPDATE_NON_SECRET as the update reason to sett_conn_changed(), which is the correct update reason in this case. --- src/core/devices/wifi/nm-iwd-manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/devices/wifi/nm-iwd-manager.c b/src/core/devices/wifi/nm-iwd-manager.c index 36c3ac826f..c7ba20eaa6 100644 --- a/src/core/devices/wifi/nm-iwd-manager.c +++ b/src/core/devices/wifi/nm-iwd-manager.c @@ -742,7 +742,9 @@ mirror_connection(NMIwdManager * self, g_object_set(G_OBJECT(s_wifi), NM_SETTING_WIRELESS_HIDDEN, hidden, NULL); } else { KnownNetworkData data = {known_network, settings_connection, id}; - sett_conn_changed(settings_connection, 0, &data); + sett_conn_changed(settings_connection, + NM_SETTINGS_CONNECTION_UPDATE_REASON_UPDATE_NON_SECRET, + &data); } }