From 9815fb38cf6b4545322a88e6102226abf700c9ae Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Thu, 8 Oct 2020 10:49:09 +0200 Subject: [PATCH] network: Check if network busy before new connection Check if we have an ongoing agent call before starting a new connection attempt and potentially overwriting network->agent_request. --- src/network.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/network.c b/src/network.c index 3e856aa1..388bc17a 100644 --- a/src/network.c +++ b/src/network.c @@ -1146,6 +1146,9 @@ static struct l_dbus_message *network_connect(struct l_dbus *dbus, */ return l_dbus_message_new_method_return(message); + if (network->agent_request) + return dbus_error_busy(message); + /* * Select the best BSS to use at this time. If we have to query the * agent this may not be the final choice because BSS visibility can @@ -1198,6 +1201,11 @@ void network_connect_new_hidden_network(struct network *network, l_debug(""); + if (network->agent_request) { + error = dbus_error_busy(*message); + goto reply_error; + } + /* * This is not a Known Network. If connection succeeds, either * network_sync_psk or network_connected will save this network