From: Daniel Wagner <[email protected]>
The call on __connman_service_disconnect() can trigger service_changed
before we fixed up the info. Therefore we should get into proper state
first.
---
src/session.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/session.c b/src/session.c
index a9edd2c..7d8b908 100644
--- a/src/session.c
+++ b/src/session.c
@@ -730,6 +730,7 @@ static connman_bool_t explicit_connect(enum
connman_session_reason reason)
static void test_and_disconnect(struct connman_session *session)
{
struct session_info *info = session->info;
+ struct connman_service *service;
if (info->entry == NULL)
return;
@@ -747,14 +748,18 @@ static void test_and_disconnect(struct connman_session
*session)
if (ecall_session != NULL && ecall_session != session)
goto out;
- __connman_service_disconnect(info->entry->service);
+ service = info->entry->service;
+ info->online = FALSE;
+ info->reason = CONNMAN_SESSION_TRIGGER_UNKNOWN;
+ info->entry = NULL;
+
+ __connman_service_disconnect(service);
/*
* TODO: We should mark this entry as pending work. In case
* disconnect fails we just unassign this session from the
* service and can't do anything later on it
*/
-
out:
info->online = FALSE;
info->entry = NULL;
--
1.7.6
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman