[PATCH 1/2] tun: Don't call tunnel script on reconnect events

Kevin Cernekee cernekee at gmail.com
Tue Nov 13 22:00:24 EST 2012


If --script-tun is used, the vpnc_script is not invoked for pre-init,
connect, or disconnect events.  However, it is invoked on reconnect, and
this may confuse the tunnel script.

Add an extra check to script_config_tun() to make the reconnect behavior
consistent with the behavior of other events.

Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 tun.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Also available via git://github.com/cernekee/openconnect.git tun


diff --git a/tun.c b/tun.c
index 3538f3c..831c11e 100644
--- a/tun.c
+++ b/tun.c
@@ -376,7 +376,7 @@ int script_config_tun(struct openconnect_info *vpninfo, const char *reason)
 {
 	int ret;
 
-	if (!vpninfo->vpnc_script)
+	if (!vpninfo->vpnc_script || vpninfo->script_tun)
 		return 0;
 
 	setenv("reason", reason, 1);
-- 
1.7.10.4




More information about the openconnect-devel mailing list