Re: [PATCH v2 1/4] knownnetworks: network: support updating known network settings

Denis Kenzior
2023-12-19T04:31:43Z

Hi James,

On 12/18/23 08:12, James Prestwood wrote:
> Currently if a known network is modified on disk the settings are not
> reloaded by network. Only disconnecting/reconnecting to the network
> would update the settings. This poses an issue to DPP since its
> creating or updating a known network after configuration then trying
> to connect. The connection itself works fine since the PSK/passphrase
> is set to the network object directly, but any additional settings
> are not updated.
>
> To fix this add a new UPDATED known network event. This is then
> handled from within network and all settings read from disk are
> applied to the network object.
> ---
> src/knownnetworks.c | 4 ++++
> src/knownnetworks.h | 1 +
> src/network.c | 27 ++++++++++++++++++++++++---
> 3 files changed, 29 insertions(+), 3 deletions(-)
>
> v2:
> * Instead of bothering with individual settings we can just use the
> new l_settings object. This would still prefer agent-obtained creds
> set into the network object but also honor any new settings written

Ehh, I'm not so sure about this. handshake_state_set_8021x_config() does a
shallow copy of the l_settings object. I think eap state machine will make
copies of the info it needs, but...

> to the profile if there is an ongoing connection. This is a much
> simpler approach (unless I'm missing something). Only questionable

Also, netconfig_load_settings is called very early in __station_connect_network,
so even if you overwrite the settings object here, it is probably too late to
take any effect.

> piece is what to do with the Security group. I hesitate to skip it
> because its what we have on disk, but it could mean the network
> object isn't synced with its settings. But I'm not sure this is
> any different than what we have today, if a profile is modified
> during an ongoing connection its settings (including security)
> won't get updated until a disconnect/reconnect.
>
> * Remove frequency sync on UPDATED event
>

Regards,
-Denis