init.c prior to daemon exit to ensure that the tun/tap interface is
closed and any added routes are deleted.
git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@5367
e7ae566f-a301-0410-adde-
c780ea21d3b5
void
openvpn_exit (const int status)
{
+ void tun_abort();
#ifdef ENABLE_PLUGIN
void plugin_abort (void);
#endif
+ tun_abort();
+
#ifdef WIN32
uninit_win32 ();
#endif
#include "occ-inline.h"
+static struct context *static_context; /* GLOBAL */
+
/*
* Crypto initialization flags
*/
SET_MTU_TUN | SET_MTU_UPPER_BOUND);
ret = true;
+ static_context = c;
}
else
{
if (force || !(c->sig->signal_received == SIGUSR1 && c->options.persist_tun))
{
+ static_context = NULL;
+
#ifdef ENABLE_MANAGEMENT
/* tell management layer we are about to close the TUN/TAP device */
if (management)
gc_free (&gc);
}
+void
+tun_abort()
+{
+ struct context *c = static_context;
+ if (c)
+ {
+ static_context = NULL;
+ do_close_tun (c, true);
+ }
+}
+
/*
* Handle delayed tun/tap interface bringup due to --up-delay or --pull
*/
dnl define the OpenVPN version
-define(PRODUCT_VERSION,[2.1.1])
+define(PRODUCT_VERSION,[2.1.1a])
dnl define the TAP version
define(PRODUCT_TAP_ID,[tap0901])
define(PRODUCT_TAP_WIN32_MIN_MAJOR,[9])