service: disconnect state has priority over online one.
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Fri, 8 Jul 2011 17:04:37 +0000 (20:04 +0300)
committerSamuel Ortiz <sameo@linux.intel.com>
Fri, 8 Jul 2011 18:01:36 +0000 (20:01 +0200)
src/service.c

index 495e4de..bfd94a5 100644 (file)
@@ -381,12 +381,18 @@ static enum connman_service_state combine_state(
        }
 
        if (state_a == CONNMAN_SERVICE_STATE_ONLINE) {
-               result = state_a;
+               if (state_b == CONNMAN_SERVICE_STATE_DISCONNECT)
+                       result = state_b;
+               else
+                       result = state_a;
                goto done;
        }
 
        if (state_b == CONNMAN_SERVICE_STATE_ONLINE) {
-               result = state_b;
+               if (state_a == CONNMAN_SERVICE_STATE_DISCONNECT)
+                       result = state_a;
+               else
+                       result = state_b;
                goto done;
        }