Skip to content

Commit 93c9b47

Browse files
lstipakovcron2
authored andcommitted
tun.c: set IPv4 address temporary on Windows
Use store=active to set IPv4 address temporary so that it will be removed on reboot. This makes the behavior consistent with deletion and IPv6, where we already use store=active. https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/netsh-interface GitHub: fixes #915 Change-Id: I07311f397e6cd278b90c33f024e927c282cd03e4 Signed-off-by: Lev Stipakov <[email protected]> Acked-by: Gert Doering <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1430 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg34975.html Signed-off-by: Gert Doering <[email protected]>
1 parent d4df0a3 commit 93c9b47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/openvpn/tun.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5119,8 +5119,8 @@ netsh_ifconfig(const struct tuntap_options *to, DWORD adapter_index, const in_ad
51195119
}
51205120
else
51215121
{
5122-
/* example: netsh interface ip set address 42 static 10.3.0.1 255.255.255.0 */
5123-
argv_printf(&argv, "%s%s interface ip set address %lu static %s %s", get_win_sys_path(),
5122+
/* example: netsh interface ip set address 42 static 10.3.0.1 255.255.255.0 store=active */
5123+
argv_printf(&argv, "%s%s interface ip set address %lu static %s %s store=active", get_win_sys_path(),
51245124
NETSH_PATH_SUFFIX, adapter_index, print_in_addr_t(ip, 0, &gc),
51255125
print_in_addr_t(netmask, 0, &gc));
51265126

0 commit comments

Comments
 (0)