From: "cron2 (Code Review)" Date: Wed, 10 Dec 2025 09:16:39 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, lstipakov@...277... Message-ID: <6ed76257f295533f5cc351e9ac0ca48683180ab4-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="hL0+FZ+xhdg="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: tun.c: set IPv4 address temporary on Windows List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: stipa Cc: plaisthos , openvpn-devel --hL0+FZ+xhdg= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/14= 30?usp=3Demail ) Change subject: tun.c: set IPv4 address temporary on Windows ...................................................................... tun.c: set IPv4 address temporary on Windows Use store=3Dactive 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=3Dactive. https://learn.microsoft.com/en-us/windows-server/administration/windows-com= mands/netsh-interface GitHub: fixes OpenVPN/openvpn#915 Change-Id: I07311f397e6cd278b90c33f024e927c282cd03e4 Signed-off-by: Lev Stipakov Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1430 Message-Id: <20251210075906.27693-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34= 975.html Signed-off-by: Gert Doering --- M src/openvpn/tun.c 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 7236033..409cecb 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -5119,8 +5119,8 @@ } else { - /* example: netsh interface ip set address 42 static 10.3.0.1 = 255.255.255.0 */ - argv_printf(&argv, "%s%s interface ip set address %lu static %= s %s", get_win_sys_path(), + /* example: netsh interface ip set address 42 static 10.3.0.1 = 255.255.255.0 store=3Dactive */ + argv_printf(&argv, "%s%s interface ip set address %lu static %= s %s store=3Dactive", get_win_sys_path(), NETSH_PATH_SUFFIX, adapter_index, print_in_addr_t(= ip, 0, &gc), print_in_addr_t(netmask, 0, &gc)); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1430?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I07311f397e6cd278b90c33f024e927c282cd03e4 Gerrit-Change-Number: 1430 Gerrit-PatchSet: 2 Gerrit-Owner: stipa Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel --hL0+FZ+xhdg= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

tun.c: set IPv4 address temporary on Windows
=
Use store=3Dactive 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=3Dactive.

https://learn.microsof= t.com/en-us/windows-server/administration/windows-commands/netsh-interface<= br>
GitHub: fixes OpenVPN/openvpn#915

Change-Id: I07311f397e6cd27= 8b90c33f024e927c282cd03e4
Signed-off-by: Lev Stipakov <lev@...515...&= gt;
Acked-by: Gert Doering <gert@...1296...>
Gerrit URL: https:= //gerrit.openvpn.net/c/openvpn/+/1430
Message-Id: <20251210075906.276= 93-1-gert@...1296...>
URL: https://www.mail-archive.com/openvpn-devel= @lists.sourceforge.net/msg34975.html
Signed-off-by: Gert Doering <ger= t@...1296...>
---
M src/openvpn/tun.c
1 file changed, 2 inserti= ons(+), 2 deletions(-)

diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index= 7236033..409cecb 100644
--- a/src/openvpn/tun.c
= +++ b/src/openvpn/tun.c
@@ -5119,8 +5119,8 @@<= br> }
else
= {
- /* examp= le: netsh interface ip set address 42 static 10.3.0.1 255.255.255.0 */
- argv_printf(&a= mp;argv, "%s%s interface ip set address %lu static %s %s", get_wi= n_sys_path(),
+ = /* example: netsh interface ip set address 42 static 10.3.0.1 255.255= .255.0 store=3Dactive */
+ argv_printf(&argv, "%s%s interface ip set address= %lu static %s %s store=3Dactive", get_win_sys_path(),
NETSH_PATH_SUFFIX, adapter_index, print_in_addr_t= (ip, 0, &gc),

print_in_addr_t(= netmask, 0, &gc));


<= p>To view, visit change 1430. To unsubscribe, or for help writing mail filters= , visit settings= .

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I07311f397e6cd278b90c33f024e= 927c282cd03e4
Gerrit-Change-Number: 1430
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <lstipakov@...277...>= ;
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --hL0+FZ+xhdg=--