From 39990a2b83308baf1372bbc8846136036a55cf50 Mon Sep 17 00:00:00 2001 From: smos Date: Tue, 10 May 2011 10:01:48 +0200 Subject: [PATCH] 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 --- tun.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, -- 2.47.2