diff options
author | Jussi Laakkonen <jussi.laakkonen@jolla.com> | 2022-02-25 12:58:00 +0200 |
---|---|---|
committer | Daniel Wagner <wagi@monom.org> | 2022-02-27 18:56:59 +0100 |
commit | a2d238c7bc515f2ce3113feb31d6c0e9067550b7 (patch) | |
tree | e4d0d42314439c77432893bd3953b68681d2a2ef /src | |
parent | 3d9b90e89f1ee44e3d8b1bcf52c9bd12f9078334 (diff) | |
download | connman-a2d238c7bc515f2ce3113feb31d6c0e9067550b7.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/service.c | 5 |
1 files changed, 4 insertions, 1 deletions
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); |