mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-23 06:02:37 +01:00
network: Create a settings file on connection
Make sure networks of all 4 security types have a settings file created or updated with a new modification time on a successful connect so that autoconnect and network sorting works for networks other than PSK too. By doing this on storage_network_touch failure we make sure we don't overwrite anything dropped into the settings directory while we were connecting.
This commit is contained in:
parent
33d2ae60e9
commit
2285ad24ab
@ -154,7 +154,19 @@ bool network_connected(struct network *network)
|
||||
goto fail;
|
||||
|
||||
err = storage_network_touch(strtype, network->ssid);
|
||||
if (err < 0)
|
||||
if (err == -ENOENT) {
|
||||
/*
|
||||
* Write an empty settings file to keep track of the
|
||||
* last connected time. This will also make iwd autoconnect
|
||||
* to this network in the future.
|
||||
* Current policy is that network becomes a Known Network
|
||||
* only on a successful connect.
|
||||
*/
|
||||
if (!network_settings_load(network))
|
||||
goto fail;
|
||||
|
||||
storage_network_sync(strtype, network->ssid, network->settings);
|
||||
} else
|
||||
goto fail;
|
||||
|
||||
err = storage_network_get_mtime(strtype, network->ssid,
|
||||
|
Loading…
Reference in New Issue
Block a user