summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2012-11-12 14:07:56 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-11-23 12:58:52 +0200
commita1562f49d0e9c7ae7906344d896df38201376505 (patch)
treeeab7b5d1e36788b84641d2fd3035578ed997da30
parent5fb8847d3b6454a8467c0b3e3f5a9db2115f8655 (diff)
downloadconnman-a1562f49d0e9c7ae7906344d896df38201376505.tar.gz
connman-a1562f49d0e9c7ae7906344d896df38201376505.tar.bz2
connman-a1562f49d0e9c7ae7906344d896df38201376505.zip
vpn: Go to failure state if vpn information cannot be found
-rw-r--r--vpn/plugins/vpn.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c
index df030b01..d0b3381a 100644
--- a/vpn/plugins/vpn.c
+++ b/vpn/plugins/vpn.c
@@ -223,14 +223,24 @@ static DBusMessage *vpn_notify(struct connman_task *task,
data = vpn_provider_get_data(provider);
name = vpn_provider_get_driver_name(provider);
- if (name == NULL)
+
+ if (name == NULL) {
+ DBG("Cannot find VPN driver for provider %p", provider);
+ vpn_provider_set_state(provider, VPN_PROVIDER_STATE_FAILURE);
return NULL;
+ }
vpn_driver_data = g_hash_table_lookup(driver_hash, name);
- if (vpn_driver_data == NULL)
+ if (vpn_driver_data == NULL) {
+ DBG("Cannot find VPN driver data for name %s", name);
+ vpn_provider_set_state(provider, VPN_PROVIDER_STATE_FAILURE);
return NULL;
+ }
state = vpn_driver_data->vpn_driver->notify(msg, provider);
+
+ DBG("provider %p driver %s state %d", provider, name, state);
+
switch (state) {
case VPN_STATE_CONNECT:
case VPN_STATE_READY: