X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fprovider.c;h=c437c91b538382c236f61b8687ffb80f78b40c6a;hb=c647a4b6f1132684c9d8b8ad71ec38d81147b278;hp=f1e4a0671f00eb06c85460322890096b1c41503f;hpb=04d1dbacf6aabbb44f16f6776496192964d460d8;p=platform%2Fupstream%2Fconnman.git diff --git a/src/provider.c b/src/provider.c index f1e4a06..c437c91 100755 --- a/src/provider.c +++ b/src/provider.c @@ -176,17 +176,24 @@ int __connman_provider_connect(struct connman_provider *provider, else return -EOPNOTSUPP; - if (err < 0) { - if (err != -EINPROGRESS) - return err; + switch (err) { + case 0: + return 0; + case -EINPROGRESS: provider_indicate_state(provider, CONNMAN_SERVICE_STATE_ASSOCIATION); - + /* fall through */ + /* + * Return EINPROGRESS also for when there is an existing pending call. + * The state should not be indicated again but the real state is + * still in progress for the provider. + */ + case -EALREADY: return -EINPROGRESS; } - return 0; + return err; } int __connman_provider_remove_by_path(const char *path) @@ -489,7 +496,7 @@ void connman_provider_set_index(struct connman_provider *provider, int index) ipconfig = __connman_service_get_ip4config(service); if (!ipconfig) { - DBG("Couldnt create ipconfig"); + DBG("Couldn't create ipconfig"); goto done; } } @@ -504,7 +511,7 @@ void connman_provider_set_index(struct connman_provider *provider, int index) ipconfig = __connman_service_get_ip6config(service); if (!ipconfig) { - DBG("Couldnt create ipconfig for IPv6"); + DBG("Couldn't create ipconfig for IPv6"); goto done; } } @@ -589,6 +596,17 @@ int connman_provider_set_nameservers(struct connman_provider *provider, return 0; } +void connman_provider_set_autoconnect(struct connman_provider *provider, + bool flag) +{ + if (!provider || !provider->vpn_service) + return; + + /* Save VPN service if autoconnect value changes */ + if (connman_service_set_autoconnect(provider->vpn_service, flag)) + __connman_service_save(provider->vpn_service); +} + static void unregister_provider(gpointer data) { struct connman_provider *provider = data;