From 0fb268f0fe305d1d977c87d13406a176a55049bb Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sun, 29 May 2011 09:16:08 +0100 Subject: [PATCH] Add 'reconnect' invocation of vpnc-script, to re-ensure routing/DNS setup If we reconnect because of an actual local network disconnect/reconnect, then something (DHCP, etc.) may have screwed up the routing and DNS according to the local configuration. Give the script a chance to remedy that. With iproute (i.e. modern Linux) it ought to work just to make vpnc-script do the same as it does on 'connect'. For other systems it's somewhat harder. For now vpnc-script will ignore it, anyway. Signed-off-by: David Woodhouse --- cstp.c | 1 + openconnect-internal.h | 1 + openconnect.html | 3 ++- tun.c | 5 +++++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cstp.c b/cstp.c index 91c6755..e29c817 100644 --- a/cstp.c +++ b/cstp.c @@ -427,6 +427,7 @@ int cstp_reconnect(struct openconnect_info *vpninfo) if (interval > RECONNECT_INTERVAL_MAX) interval = RECONNECT_INTERVAL_MAX; } + script_reconnect(vpninfo); return 0; } diff --git a/openconnect-internal.h b/openconnect-internal.h index 622d939..94cf4e5 100644 --- a/openconnect-internal.h +++ b/openconnect-internal.h @@ -234,6 +234,7 @@ struct openconnect_info { int setup_tun(struct openconnect_info *vpninfo); int tun_mainloop(struct openconnect_info *vpninfo, int *timeout); void shutdown_tun(struct openconnect_info *vpninfo); +void script_reconnect (struct openconnect_info *vpninfo); /* dtls.c */ unsigned char unhex(const char *data); diff --git a/openconnect.html b/openconnect.html index d87270a..c623ccf 100644 --- a/openconnect.html +++ b/openconnect.html @@ -182,6 +182,7 @@ For full changelog entries including the latest development, see