@@ -44,10 +44,11 @@ enum connman_provider_type {
enum connman_provider_state {
CONNMAN_PROVIDER_STATE_UNKNOWN = 0,
CONNMAN_PROVIDER_STATE_IDLE = 1,
- CONNMAN_PROVIDER_STATE_CONNECT = 2,
- CONNMAN_PROVIDER_STATE_READY = 3,
- CONNMAN_PROVIDER_STATE_DISCONNECT = 4,
- CONNMAN_PROVIDER_STATE_FAILURE = 5,
+ CONNMAN_PROVIDER_STATE_ASSOCIATION = 2,
+ CONNMAN_PROVIDER_STATE_CONNECT = 3,
+ CONNMAN_PROVIDER_STATE_READY = 4,
+ CONNMAN_PROVIDER_STATE_DISCONNECT = 5,
+ CONNMAN_PROVIDER_STATE_FAILURE = 6,
};
enum connman_provider_error {
@@ -126,6 +126,22 @@ static int provider_indicate_state(struct connman_provider *provider,
{
DBG("state %d", state);
+ switch (state) {
+ case CONNMAN_SERVICE_STATE_UNKNOWN:
+ case CONNMAN_SERVICE_STATE_IDLE:
+ case CONNMAN_SERVICE_STATE_ASSOCIATION:
+ break;
+ case CONNMAN_SERVICE_STATE_CONFIGURATION:
+ __connman_service_start_connect_timeout(provider->vpn_service,
+ true);
+ break;
+ case CONNMAN_SERVICE_STATE_READY:
+ case CONNMAN_SERVICE_STATE_ONLINE:
+ case CONNMAN_SERVICE_STATE_DISCONNECT:
+ case CONNMAN_SERVICE_STATE_FAILURE:
+ break;
+ }
+
__connman_service_ipconfig_indicate_state(provider->vpn_service, state,
CONNMAN_IPCONFIG_TYPE_IPV4);
@@ -291,9 +307,13 @@ int connman_provider_set_state(struct connman_provider *provider,
return -EINVAL;
case CONNMAN_PROVIDER_STATE_IDLE:
return set_connected(provider, false);
- case CONNMAN_PROVIDER_STATE_CONNECT:
+ case CONNMAN_PROVIDER_STATE_ASSOCIATION:
+ /* Connect timeout is not effective for VPNs in this state */
return provider_indicate_state(provider,
CONNMAN_SERVICE_STATE_ASSOCIATION);
+ case CONNMAN_PROVIDER_STATE_CONNECT:
+ return provider_indicate_state(provider,
+ CONNMAN_SERVICE_STATE_CONFIGURATION);
case CONNMAN_PROVIDER_STATE_READY:
return set_connected(provider, true);
case CONNMAN_PROVIDER_STATE_DISCONNECT: