eiwd

no dbus iwd with iwctl functionality
git clone https://git.daat.foo/repos/eiwd.git
Log | Files | Refs | Submodules | README | LICENSE

commit abeed797c052b832622dc092ebe2e03d784ed3cc
parent 3065e0768c0e19b1f97b3e6c096e9bfa7f8f6fcb
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date:   Fri, 10 Aug 2018 03:00:46 +0200

network: Reload settings in network_sync_psk

Reload the network settings from disk before calling
storage_network_sync in network_sync_psk to avoid potentially
overwriting changes made to the storage by user since the connection
attempt started.  This won't account for all situations but it
covers some of them and doesn't cost us much.

Diffstat:
Msrc/network.c | 9+++++++--
1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/network.c b/src/network.c @@ -427,17 +427,22 @@ static int network_load_psk(struct network *network) void network_sync_psk(struct network *network) { char *hex; + struct l_settings *fs_settings; if (!network->update_psk) return; network->update_psk = false; + + fs_settings = storage_network_open(SECURITY_PSK, network->info->ssid); hex = l_util_hexstring(network->psk, 32); l_settings_set_value(network->settings, "Security", "PreSharedKey", hex); + l_settings_set_value(fs_settings, "Security", "PreSharedKey", hex); l_free(hex); - storage_network_sync(SECURITY_PSK, network->info->ssid, - network->settings); + + storage_network_sync(SECURITY_PSK, network->info->ssid, fs_settings); + l_settings_free(fs_settings); } int network_autoconnect(struct network *network, struct scan_bss *bss)