If we are trying to connect a service and there is another
service connecting, then we disconnect the pending service
and connect the new one.
Fixes BMC#25981
---
src/service.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/service.c b/src/service.c
index 78e904f..469140a 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3789,8 +3789,18 @@ static DBusMessage *connect_service(DBusConnection *conn,
if (service->type == temp->type &&
is_connecting(temp) == TRUE &&
is_interface_available(service,
- temp) == FALSE)
- return __connman_error_in_progress(msg);
+ temp) == FALSE) {
+ if (temp->pending != NULL)
+ __connman_service_return_error(temp,
+ ECONNABORTED,
+ NULL);
+
+ err = __connman_service_disconnect(temp);
+ if (err < 0 && err != -EINPROGRESS)
+ return __connman_error_in_progress(msg);
+ else
+ break;
+ }
iter = g_sequence_iter_next(iter);
}
--
1.7.11.4
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman