summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorGert Doering <gert@greenie.muc.de>2010-02-28 22:57:28 +0100
committerGert Doering <gert@greenie.muc.de>2011-04-24 17:22:40 +0200
commitb52c5256efd5f0120a1322b0b9089c96dbedfe56 (patch)
tree924ebe1287ec6b5d3f436662d758027cd04315ed /init.c
parent6607def82270d0c31900736912e12dfec7a025b4 (diff)
downloadopenvpn-b52c5256efd5f0120a1322b0b9089c96dbedfe56.tar.gz
openvpn-b52c5256efd5f0120a1322b0b9089c96dbedfe56.tar.xz
openvpn-b52c5256efd5f0120a1322b0b9089c96dbedfe56.zip
- Win32 IPv6 ifconfig support, using "netsh" calls
- initialize tuntap->ipv6 in init.c::do_init_tun(), to make sure it's setup "early enough", no matter what ifconfig_order() wants - change call convention for open_tun(): drop "ipv6" flag, because it's incompatible with windows/openbsd calling sequence (ifconfig first, open_tun later) - also affects open_tun_generic() and tuncfg(). - drop ipv6_support() helper function - has no useful purpose anymore - introduce add_route_connected_v6_net() helper for Win32, Darwin, Netbsd (cleanup code) - fix NetBSD tunnel setup - destroy/recreate before ifconfig'ing, to make sure no leftover configuration lingers on tunnel from previous call (NetBSD tunnels are always persistent unless explicitely destroyed) - DARWIN (MacOS X) gets its own #ifdef section for open_tun()/close_tun() now, because close_tun() needs to cleanup IPv6 ifconfig
Diffstat (limited to 'init.c')
-rw-r--r--init.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/init.c b/init.c
index d716495..6ca3c55 100644
--- a/init.c
+++ b/init.c
@@ -843,7 +843,7 @@ do_persist_tuntap (const struct options *options)
msg (M_FATAL|M_OPTERR,
"options --mktun or --rmtun should only be used together with --dev");
tuncfg (options->dev, options->dev_type, options->dev_node,
- options->tun_ipv6, options->persist_mode,
+ options->persist_mode,
options->username, options->groupname, &options->tuntap_options);
if (options->persist_mode && options->lladdr)
set_lladdr(options->dev, options->lladdr, NULL);
@@ -1282,6 +1282,9 @@ do_init_tun (struct context *c)
!c->options.ifconfig_nowarn,
c->c2.es);
+ /* flag tunnel for IPv6 config if --tun-ipv6 is set */
+ c->c1.tuntap->ipv6 = c->options.tun_ipv6;
+
init_tun_post (c->c1.tuntap,
&c->c2.frame,
&c->options.tuntap_options);
@@ -1331,7 +1334,7 @@ do_open_tun (struct context *c)
/* open the tun device */
open_tun (c->options.dev, c->options.dev_type, c->options.dev_node,
- c->options.tun_ipv6, c->c1.tuntap);
+ c->c1.tuntap);
/* set the hardware address */
if (c->options.lladdr)