summaryrefslogtreecommitdiff
path: root/src/provider.c
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2011-09-14 15:34:59 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-09-29 16:54:06 +0200
commit4380ea04afa4ba80e2f272bd02996bb2f93875a4 (patch)
tree32af21232a5fec0f2bee99086c947233c93c5866 /src/provider.c
parent64e678c687076b462f6089441f0414efb2f9ddde (diff)
downloadconnman-4380ea04afa4ba80e2f272bd02996bb2f93875a4.tar.gz
connman-4380ea04afa4ba80e2f272bd02996bb2f93875a4.tar.bz2
connman-4380ea04afa4ba80e2f272bd02996bb2f93875a4.zip
provider: Remove provider if there is an error when connecting
If vpn service cannot be started for some reason, we must remove the provider so that user can reconnect to it later.
Diffstat (limited to 'src/provider.c')
-rw-r--r--src/provider.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/provider.c b/src/provider.c
index d6d1b7ed..9f7050fe 100644
--- a/src/provider.c
+++ b/src/provider.c
@@ -359,6 +359,8 @@ int connman_provider_indicate_error(struct connman_provider *provider,
enum connman_provider_error error)
{
enum connman_service_error service_error;
+ const char *path;
+ int ret;
switch (error) {
case CONNMAN_PROVIDER_ERROR_LOGIN_FAILED:
@@ -375,8 +377,12 @@ int connman_provider_indicate_error(struct connman_provider *provider,
break;
}
- return __connman_service_indicate_error(provider->vpn_service,
+ ret = __connman_service_indicate_error(provider->vpn_service,
service_error);
+ path = __connman_service_get_path(provider->vpn_service);
+ __connman_provider_remove(path);
+
+ return ret;
}
static void unregister_provider(gpointer data)