From: smos Date: Tue, 10 May 2011 08:01:48 +0000 (+0200) Subject: Change the netsh.exe command from "add" to "set". X-Git-Tag: v2.3-alpha1~232^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39990a2b83308baf1372bbc8846136036a55cf50;p=thirdparty%2Fopenvpn.git Change the netsh.exe command from "add" to "set". This prevents the netsh.exe command from exiting with a status 1 when the address already exists. By adding store=active the address will not survive a reboot and be assigned temporarily. Tested on Windows 7 and Windows XP SP 2. Signed-off-by: smos Acked-by: Gert Doering Signed-off-by: Gert Doering --- diff --git a/tun.c b/tun.c index 45db2b550..55d66e11a 100644 --- a/tun.c +++ b/tun.c @@ -1167,9 +1167,9 @@ do_ifconfig (struct tuntap *tt, if (!strcmp (actual, "NULL")) msg (M_FATAL, "Error: When using --tun-ipv6, if you have more than one TAP-Win32 adapter, you must also specify --dev-node"); - /* example: netsh interface ipv6 add address MyTap 2001:608:8003::d */ + /* example: netsh interface ipv6 set address MyTap 2001:608:8003::d store=active */ argv_printf (&argv, - "%s%sc interface ipv6 add address %s %s", + "%s%sc interface ipv6 set address %s %s store=active", get_win_sys_path(), NETSH_PATH_SUFFIX, actual,