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.
This commit is contained in:
Jonas Dreßler 2021-04-25 11:18:48 +02:00 committed by Thomas Haller
parent c8608d7cc3
commit 971dcc0777
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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);
}
}