From a2d238c7bc515f2ce3113feb31d6c0e9067550b7 Mon Sep 17 00:00:00 2001 From: Jussi Laakkonen Date: Fri, 25 Feb 2022 12:58:00 +0200 Subject: service: Check if hidden service has a pending request on agent Hidden (WiFi) services do not save the pending request to the service struct and this utilizes agent-connman.c to check if there is a agent request already set for the service. In such case this reports in progress error back to the caller as with visible service. Otherwise there would be a possibility to request connect for at least twice for a hidden WiFi network. And when agent is in use this would result in two requests to be sent, first one is the current active one and the second would be waiting in agent queue, which in case of time-out would be then be sent to the agent as a duplicate request. --- src/service.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/service.c b/src/service.c index 1d2b78a6..f1abb963 100644 --- a/src/service.c +++ b/src/service.c @@ -4562,7 +4562,10 @@ static DBusMessage *connect_service(DBusConnection *conn, DBG("service %p", service); - if (service->pending) + /* Hidden services do not keep the pending msg, check it from agent */ + if (service->pending || (service->hidden && + __connman_agent_is_request_pending(service, + dbus_message_get_sender(msg)))) return __connman_error_in_progress(msg); index = __connman_service_get_index(service); -- cgit v1.2.1