We should not try to change the state if the corresponding ipconfig
is set to be OFF. What this means that we change the state and
combine ipv4 and ipv6 states only if both are active. This patch is
needed by provider and the VPN authentication failure case.
---
 src/service.c |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/src/service.c b/src/service.c
index 133e5cf..27ad068 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3727,11 +3727,21 @@ int __connman_service_ipconfig_indicate_state(struct 
connman_service *service,
                break;
        }
 
-       /* We keep that state */
-       if (type == CONNMAN_IPCONFIG_TYPE_IPV4)
-               service->state_ipv4 = new_state;
-       else if (type == CONNMAN_IPCONFIG_TYPE_IPV6)
-               service->state_ipv6 = new_state;
+       /* We keep that state but only if the method is not OFF */
+       if (type == CONNMAN_IPCONFIG_TYPE_IPV4) {
+               enum connman_ipconfig_method method;
+               method = __connman_ipconfig_get_method(service->ipconfig_ipv4);
+               if (method != CONNMAN_IPCONFIG_METHOD_OFF &&
+                               method != CONNMAN_IPCONFIG_METHOD_UNKNOWN)
+                       service->state_ipv4 = new_state;
+
+       } else if (type == CONNMAN_IPCONFIG_TYPE_IPV6) {
+               enum connman_ipconfig_method method;
+               method = __connman_ipconfig_get_method(service->ipconfig_ipv6);
+               if (method != CONNMAN_IPCONFIG_METHOD_OFF &&
+                               method != CONNMAN_IPCONFIG_METHOD_UNKNOWN)
+                       service->state_ipv6 = new_state;
+       }
 
        return service_indicate_state(service);
 }
-- 
1.7.1

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

Reply via email to