]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Change the netsh.exe command from "add" to "set".
authorsmos <seth.mos@dds.nl>
Tue, 10 May 2011 08:01:48 +0000 (10:01 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 19 May 2011 17:46:09 +0000 (19:46 +0200)
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 <seth.mos@dds.nl>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: Gert Doering <gert@greenie.muc.de>
tun.c

diff --git a/tun.c b/tun.c
index 45db2b550348ca674441c00272b17e7e4196c69e..55d66e11ad3af4210fed39491b3ac631ff5b3bc9 100644 (file)
--- 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,