[PATCH v3 18/21] vpn: Driver disconnect needs provider information

Jukka Rissanen jukka.rissanen at linux.intel.com
Fri Nov 30 01:30:51 PST 2012


The provider pointer needs to be passed to VPN driver when
disconnecting. Otherwise we cannot find the correct provider
that is being disconnected.
---
 vpn/plugins/vpn.c | 2 +-
 vpn/plugins/vpn.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/vpn/plugins/vpn.c b/vpn/plugins/vpn.c
index a8603d9..05068f5 100644
--- a/vpn/plugins/vpn.c
+++ b/vpn/plugins/vpn.c
@@ -458,7 +458,7 @@ static int vpn_disconnect(struct vpn_provider *provider)
 
 	vpn_driver_data = g_hash_table_lookup(driver_hash, name);
 	if (vpn_driver_data->vpn_driver->disconnect)
-		vpn_driver_data->vpn_driver->disconnect();
+		vpn_driver_data->vpn_driver->disconnect(provider);
 
 	if (data->watch != 0) {
 		vpn_provider_unref(provider);
diff --git a/vpn/plugins/vpn.h b/vpn/plugins/vpn.h
index d1e322c..6f86aac 100644
--- a/vpn/plugins/vpn.h
+++ b/vpn/plugins/vpn.h
@@ -46,7 +46,7 @@ struct vpn_driver {
 	int (*connect) (struct vpn_provider *provider,
 			struct connman_task *task, const char *if_name,
 			vpn_provider_connect_cb_t cb, void *user_data);
-	void (*disconnect) (void);
+	void (*disconnect) (struct vpn_provider *provider);
 	int (*error_code) (int exit_code);
 	int (*save) (struct vpn_provider *provider, GKeyFile *keyfile);
 };
-- 
1.7.11.4




More information about the connman mailing list