If we have IPv6 state as DISCONNECT and IPv4 state as
ONLINE or READY then we are not disconnected.
---
 src/service.c |   64 ++++++++++++++------------------------------------------
 1 files changed, 16 insertions(+), 48 deletions(-)

diff --git a/src/service.c b/src/service.c
index fcbfc87..9319323 100644
--- a/src/service.c
+++ b/src/service.c
@@ -327,75 +327,43 @@ static enum connman_service_state combine_state(
                goto done;
        }
 
-       if (state_a == CONNMAN_SERVICE_STATE_ASSOCIATION) {
-               if (state_b == CONNMAN_SERVICE_STATE_CONFIGURATION ||
-                               state_b == CONNMAN_SERVICE_STATE_ONLINE ||
-                               state_b == CONNMAN_SERVICE_STATE_READY)
-                       result = state_b;
-               else
-                       result = state_a;
+       if (state_a == CONNMAN_SERVICE_STATE_ONLINE) {
+               result = state_a;
                goto done;
        }
 
-       if (state_b == CONNMAN_SERVICE_STATE_ASSOCIATION) {
-               if (state_a == CONNMAN_SERVICE_STATE_CONFIGURATION ||
-                               state_a == CONNMAN_SERVICE_STATE_ONLINE ||
-                               state_a == CONNMAN_SERVICE_STATE_READY)
-                       result = state_a;
-               else
-                       result = state_b;
+       if (state_b == CONNMAN_SERVICE_STATE_ONLINE) {
+               result = state_b;
                goto done;
        }
 
-       if (state_a == CONNMAN_SERVICE_STATE_CONFIGURATION) {
-               if (state_b == CONNMAN_SERVICE_STATE_ONLINE ||
-                               state_b == CONNMAN_SERVICE_STATE_READY)
-                       result = state_b;
-               else
-                       result = state_a;
+       if (state_a == CONNMAN_SERVICE_STATE_READY) {
+               result = state_a;
                goto done;
        }
 
-       if (state_b == CONNMAN_SERVICE_STATE_CONFIGURATION) {
-               if (state_a == CONNMAN_SERVICE_STATE_ONLINE ||
-                               state_a == CONNMAN_SERVICE_STATE_READY)
-                       result = state_a;
-               else
-                       result = state_b;
+       if (state_b == CONNMAN_SERVICE_STATE_READY) {
+               result = state_b;
                goto done;
        }
 
-       if (state_a == CONNMAN_SERVICE_STATE_READY) {
-               if (state_b == CONNMAN_SERVICE_STATE_ONLINE ||
-                               state_b == CONNMAN_SERVICE_STATE_DISCONNECT)
-                       result = state_b;
-               else
-                       result = state_a;
+       if (state_a == CONNMAN_SERVICE_STATE_CONFIGURATION) {
+               result = state_a;
                goto done;
        }
 
-       if (state_b == CONNMAN_SERVICE_STATE_READY) {
-               if (state_a == CONNMAN_SERVICE_STATE_ONLINE ||
-                               state_a == CONNMAN_SERVICE_STATE_DISCONNECT)
-                       result = state_a;
-               else
-                       result = state_b;
+       if (state_b == CONNMAN_SERVICE_STATE_CONFIGURATION) {
+               result = state_b;
                goto done;
        }
 
-       if (state_a == CONNMAN_SERVICE_STATE_ONLINE) {
-               if (state_b == CONNMAN_SERVICE_STATE_DISCONNECT)
-                       result = state_b;
-               else
-                       result = state_a;
+       if (state_a == CONNMAN_SERVICE_STATE_ASSOCIATION) {
+               result = state_a;
                goto done;
        }
 
-       if (state_b == CONNMAN_SERVICE_STATE_ONLINE) {
-               if (state_a == CONNMAN_SERVICE_STATE_DISCONNECT)
-                       result = state_a;
-               else
-                       result = state_b;
+       if (state_b == CONNMAN_SERVICE_STATE_ASSOCIATION) {
+               result = state_b;
                goto done;
        }
 
-- 
1.7.1

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to