>From dec3c20e749f864636669600dc92ebee3cf1001f Mon Sep 17 00:00:00 2001
From: Jeongseok Seo <[email protected]>
Date: Wed, 7 Dec 2011 22:35:20 +0900
Subject: [PATCH] service: Clear service->pending to avoid in-progress error

During configuration(dhcp), service may get disconnect from supplicant. Its
state transits association -> disconnect -> idle and service cannot call
reply_pending.
---
 src/service.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/src/service.c b/src/service.c
index 0ab313c..8c4f80d 100644
--- a/src/service.c
+++ b/src/service.c
@@ -4059,11 +4059,8 @@ static int service_indicate_state(struct
connman_service *service)
        state_changed(service);

        if (new_state == CONNMAN_SERVICE_STATE_IDLE &&
-                       old_state != CONNMAN_SERVICE_STATE_DISCONNECT) {
-               reply_pending(service, ECONNABORTED);
-
+                       old_state != CONNMAN_SERVICE_STATE_DISCONNECT)
                __connman_service_disconnect(service);
-       }

        if (new_state == CONNMAN_SERVICE_STATE_CONFIGURATION) {
                if (__connman_stats_service_register(service) == 0) {
@@ -4086,6 +4083,8 @@ static int service_indicate_state(struct
connman_service *service)
        if (new_state == CONNMAN_SERVICE_STATE_IDLE) {
                connman_bool_t reconnect;

+               reply_pending(service, ECONNABORTED);
+
                reconnect = get_reconnect_state(service);
                if (reconnect == TRUE)
                        __connman_service_auto_connect();
-- 
1.7.5.4


_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to