eiwd

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

commit 85d9d6461f1f8fa7fde86455da95d94e00f756ad
parent 57ae02ab711859da541bdf0680f75feb5eaa8ab1
Author: Emmanuel VAUTRIN <Emmanuel.VAUTRIN@cpexterne.org>
Date:   Tue,  5 Apr 2022 10:21:33 +0200

network: Hide hidden networks on connection error

If a user connection fails on a freshly scanned psk or open hidden
network, during passphrase request or after, it shall be removed from
the network list.  Otherwise, it would be possible to directly connect
to that known network, which will appear as not hidden.

Diffstat:
Msrc/network.c | 11+++++++++++
Msrc/station.c | 2++
2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/src/network.c b/src/network.c @@ -85,6 +85,7 @@ struct network { bool is_hs20:1; bool anqp_pending:1; /* Set if there is a pending ANQP request */ bool owe_hidden_pending:1; + bool provisioning_hidden:1; uint8_t transition_disable; /* Temporary cache until info is set */ bool have_transition_disable:1; int rank; @@ -188,6 +189,8 @@ void network_connected(struct network *network) network_secret_check_cacheable, network); l_queue_clear(network->blacklist, NULL); + + network->provisioning_hidden = false; } void network_disconnected(struct network *network) @@ -980,6 +983,9 @@ void network_connect_failed(struct network *network, bool in_handshake) l_queue_destroy(network->secrets, eap_secret_info_free); network->secrets = NULL; + + if (network->provisioning_hidden) + station_hide_network(network->station, network); } static bool hotspot_info_matches(struct network *network, @@ -1242,6 +1248,9 @@ static void passphrase_callback(enum agent_result result, return; err: + if (network->provisioning_hidden) + station_hide_network(station, network); + network_settings_close(network); } @@ -1661,8 +1670,10 @@ struct l_dbus_message *network_connect_new_hidden_network( switch (network_get_security(network)) { case SECURITY_PSK: + network->provisioning_hidden = true; return network_connect_psk(network, bss, message); case SECURITY_NONE: + network->provisioning_hidden = true; station_connect_network(station, network, bss, message); return NULL; default: diff --git a/src/station.c b/src/station.c @@ -3198,6 +3198,8 @@ next: } if (network_psk && network_open) { + station_hide_network(station, network_psk); + station_hide_network(station, network_open); dbus_pending_reply(&msg, dbus_error_service_set_overlap(msg)); return true; }