summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-02-24 16:09:50 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2011-02-24 16:09:50 +0100
commit78a203e7c156b2231e6fd0270d3ea8d7bfa5d2b7 (patch)
tree810e8c64837d00e1c0ad1243ce52f77ffe46c828 /src
parent1773bb1001d9edb90c21a57a9de5f7fd35881f8e (diff)
downloadconnman-78a203e7c156b2231e6fd0270d3ea8d7bfa5d2b7.tar.gz
connman-78a203e7c156b2231e6fd0270d3ea8d7bfa5d2b7.tar.bz2
connman-78a203e7c156b2231e6fd0270d3ea8d7bfa5d2b7.zip
service: Do not always reset the IPv4 state on error clearing
When clearing the service error from the oFono plugin, moving the IPv6 state to IDLE can trigger an automatic connection and thus move the IPv4 to the ASSOCIATING state.
Diffstat (limited to 'src')
-rw-r--r--src/service.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/service.c b/src/service.c
index 91b7739d..a103549f 100644
--- a/src/service.c
+++ b/src/service.c
@@ -3604,6 +3604,14 @@ int __connman_service_clear_error(struct connman_service *service)
__connman_service_indicate_state(service, CONNMAN_SERVICE_STATE_IDLE,
CONNMAN_IPCONFIG_TYPE_IPV6);
+ /*
+ * Toggling the IPv6 state to IDLE could trigger the auto connect
+ * machinery and consequently the IPv4 state.
+ */
+ if (service->state_ipv4 != CONNMAN_SERVICE_STATE_UNKNOWN &&
+ service->state_ipv4 != CONNMAN_SERVICE_STATE_FAILURE)
+ return 0;
+
return __connman_service_indicate_state(service,
CONNMAN_SERVICE_STATE_IDLE,
CONNMAN_IPCONFIG_TYPE_IPV4);