commit 9815fb38cf6b4545322a88e6102226abf700c9ae
parent 758dba214e29d7c09d4559d36966e4dbbf8ba9ca
Author: Andrew Zaborowski <andrew.zaborowski@intel.com>
Date: Thu, 8 Oct 2020 10:49:09 +0200
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.
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git 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