| Message ID | 20251210075906.27693-1-gert@greenie.muc.de |
|---|---|
| State | New |
| Headers |
Return-Path: <openvpn-devel-bounces@lists.sourceforge.net>
Delivered-To: patchwork@openvpn.net
Received: by 2002:a05:7000:29c3:b0:7b1:439f:bdf with SMTP id g3csp1889554max;
Tue, 9 Dec 2025 23:59:26 -0800 (PST)
X-Forwarded-Encrypted: i=2;
AJvYcCUlfhf4WBzycbIClG/PEQudftoArdmjMMUgODrSpeegZuXioZ2e8ms4eSI9aN3v/ck/a8LkxTEpB0o=@openvpn.net
X-Google-Smtp-Source:
AGHT+IGZwF2SMwHAMPSToFj0+ZvVgyK/ubHtfgg4ok7kNmwIuMfrWv0HjsDDTk8O9x5phui9VH7U
X-Received: by 2002:a05:6820:168d:b0:65b:248f:b4ad with SMTP id
006d021491bc7-65b2abc1f67mr1007607eaf.14.1765353566285;
Tue, 09 Dec 2025 23:59:26 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1765353566; cv=none;
d=google.com; s=arc-20240605;
b=jy6T3PqmJnRWzeWPJs0qHvSL/GdOEO6kaHkUsfx4FztQFpYNok2xTqQKWrg13EaFH+
0iAEIhZ6duB6a6iCtGNjtBTrHOfZvAjo2wEPnbfCden5S/O0gsCyHItAKAkFznK1admJ
vcXWkivzxMTfJLG16Au9vAvVrT/GwKnWzfURtSqaGNVyY66jqosa5PGS0/vWCdBtseal
EEI8WneOBuU+o0Ei0z3na0kWO1fu5TAnY9N7uDBB20pL9I6Zo790F5V07KjMiXFrfBAt
XVJKcdjhUjfB+Kw8glWuJ913dJao7y5LQE6HOQFZNmQj4HcUVo4dStgPody+l/q0356m
VtuA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;
s=arc-20240605;
h=errors-to:content-transfer-encoding:list-subscribe:list-help
:list-post:list-archive:list-unsubscribe:list-id:precedence:subject
:mime-version:references:in-reply-to:message-id:date:to:from
:dkim-signature:dkim-signature:dkim-signature;
bh=FEjEiaaTrbj4YZJlCCO9NP9rIrezlfjP56rcNIqNzgU=;
fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=;
b=CxoUFKdQkDJ4Z/Okb6iJMD9WA2vEbX08NJbRxVozRKzAE2Si63MxOMmNJaxxuQ/iCi
KlpetZOrORb6I+YYZWL3b7kH1iVLjnqHcCqVX7kpuBBF8D4AorDwuQ3yRzN/oGSthQ87
zy99zXllzHcDeYJvw9jCEyZl9tMMVNOc82h7At2OWabLGW9IjnfR4if2EgABL9iqO0tC
NJEYk2ZPYY6R6VDNQw+/QtAp93U3GRq8sbtOfoDg8MG1mO9sweCMdRaq/H5l2wX4ymIy
XFc3JViUa2S62yinjOLu2YQby54MWPg54Fauhq0KQY+f/22cYvyasllXyBFh4q6qyoFJ
0SYQ==;
dara=google.com
ARC-Authentication-Results: i=1; mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=CC0mnWtQ;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=HDppU2oa;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=T2BwO5z8;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net;
dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de
Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7])
by mx.google.com with ESMTPS id
006d021491bc7-65b268392c4si1786191eaf.33.2025.12.09.23.59.26
(version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
Tue, 09 Dec 2025 23:59:26 -0800 (PST)
Received-SPF: pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) client-ip=216.105.38.7;
Authentication-Results: mx.google.com;
dkim=pass header.i=@lists.sourceforge.net header.s=beta
header.b=CC0mnWtQ;
dkim=neutral (body hash did not verify) header.i=@sourceforge.net
header.s=x header.b=HDppU2oa;
dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x
header.b=T2BwO5z8;
spf=pass (google.com: domain of
openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as
permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net;
dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type:
List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:
Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender:
Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From:
Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner;
bh=FEjEiaaTrbj4YZJlCCO9NP9rIrezlfjP56rcNIqNzgU=; b=CC0mnWtQ6zi8koDe59+Sb2xOD/
hBq/kV7bQcIlF2le5J8h3GeqmYDC3lIiuM6e0T1GgMn6FpgRzgwAM1Dl7zyLvjtM7NE2QM7febH7z
f61M2HCL+NzqA2pTWOdmvs76L+LJVonxnVWhiaFMIo7+qsMLmtBuJWSmpnXi0bVOWnG0=;
Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com)
by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95)
(envelope-from <openvpn-devel-bounces@lists.sourceforge.net>)
id 1vTF6Y-0004ec-7u;
Wed, 10 Dec 2025 07:59:22 +0000
Received: from [172.30.29.66] (helo=mx.sourceforge.net)
by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls
TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95)
(envelope-from <gert@blue4.greenie.muc.de>) id 1vTF6X-0004eV-D9
for openvpn-devel@lists.sourceforge.net;
Wed, 10 Dec 2025 07:59:21 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References:
In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:
Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
List-Subscribe:List-Post:List-Owner:List-Archive;
bh=/LnuoWqGLLdoaqILexwmOpVpdsZSvJJbhemqmw1m0J4=; b=HDppU2oaVkAGmYK2+G1w17lgB5
Vr8jGg6369UPlv+XjQ8MHkOLULVyJn/iNQmHSEGInJesclZEG8VCz/oGUVJrPBmFSRinhjk2tz20A
UH4rkPOMqJ6K72gMyZrpBxCCRE/c2vYzt24EXjNwC6IEzBCLC8Q7me3QJsixfWw5aGAY=;
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x
;
h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:
Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID:
Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc
:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:
List-Post:List-Owner:List-Archive;
bh=/LnuoWqGLLdoaqILexwmOpVpdsZSvJJbhemqmw1m0J4=; b=T2BwO5z8hAhTebEZtkBXfe9Orr
EIN/ddETQTEKQJvZmkfxA33fJhsdPAK+tKGixYf/NOHlQkqOzHzeRPVw38YL46/tEc7D25ECVisdq
1v0iaWF+SKNx8YMVgApHGfKNwfW2jMI29XwSjjkRvhcH95r0BSkxeI7os7O3qiNjc2NM=;
Received: from [193.149.48.134] (helo=blue.greenie.muc.de)
by sfi-mx-2.v28.lw.sourceforge.com with esmtps
(TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95)
id 1vTF6U-0005i5-Hj for openvpn-devel@lists.sourceforge.net;
Wed, 10 Dec 2025 07:59:19 +0000
Received: from blue.greenie.muc.de (localhost [127.0.0.1])
by blue.greenie.muc.de (8.18.1/8.18.1) with ESMTP id 5BA7x7hr027713
for <openvpn-devel@lists.sourceforge.net>; Wed, 10 Dec 2025 08:59:07 +0100
Received: (from gert@localhost)
by blue.greenie.muc.de (8.18.1/8.18.1/Submit) id 5BA7x7WJ027712
for openvpn-devel@lists.sourceforge.net; Wed, 10 Dec 2025 08:59:07 +0100
From: Gert Doering <gert@greenie.muc.de>
To: openvpn-devel@lists.sourceforge.net
Date: Wed, 10 Dec 2025 08:59:00 +0100
Message-ID: <20251210075906.27693-1-gert@greenie.muc.de>
X-Mailer: git-send-email 2.51.2
In-Reply-To:
<gerrit.1765353329000.I07311f397e6cd278b90c33f024e927c282cd03e4@gerrit.openvpn.net>
References:
<gerrit.1765353329000.I07311f397e6cd278b90c33f024e927c282cd03e4@gerrit.openvpn.net>
MIME-Version: 1.0
X-Spam-Score: 1.3 (+)
X-Spam-Report: Spam detection software,
running on the system "sfi-spamd-1.hosts.colo.sdot.me",
has NOT identified this incoming email as spam. The original
message has been attached to this so you can view it or label
similar future email. If you have any questions, see
the administrator of that system for details.
Content preview: From: Lev Stipakov <lev@openvpn.net> 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.
Content analysis details: (1.3 points, 5.0 required)
pts rule name description
---- ----------------------
--------------------------------------------------
1.3 RDNS_NONE Delivered to internal network by a host with no rDNS
X-Headers-End: 1vTF6U-0005i5-Hj
Subject: [Openvpn-devel] [PATCH v1] tun.c: set IPv4 address temporary on
Windows
X-BeenThere: openvpn-devel@lists.sourceforge.net
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <openvpn-devel.lists.sourceforge.net>
List-Unsubscribe: <https://lists.sourceforge.net/lists/options/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=unsubscribe>
List-Archive:
<http://sourceforge.net/mailarchive/forum.php?forum_name=openvpn-devel>
List-Post: <mailto:openvpn-devel@lists.sourceforge.net>
List-Help: <mailto:openvpn-devel-request@lists.sourceforge.net?subject=help>
List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>,
<mailto:openvpn-devel-request@lists.sourceforge.net?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: openvpn-devel-bounces@lists.sourceforge.net
X-getmail-retrieved-from-mailbox: Inbox
X-GMAIL-THRID: =?utf-8?q?1851107381498474313?=
X-GMAIL-MSGID: =?utf-8?q?1851107381498474313?=
|
| Series |
[Openvpn-devel,v1] tun.c: set IPv4 address temporary on Windows
|
|
Commit Message
Gert Doering
Dec. 10, 2025, 7:59 a.m. UTC
From: Lev Stipakov <lev@openvpn.net> 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: https://github.com/OpenVPN/openvpn/issues/915 Change-Id: I07311f397e6cd278b90c33f024e927c282cd03e4 Signed-off-by: Lev Stipakov <lev@openvpn.net> Acked-by: Gert Doering <gert@greenie.muc.de> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1430 --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1430 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering <gert@greenie.muc.de>
Comments
Arguably this is a bug, but it's a bug in a dark corner of a niche use
case - *if* running OpenVPN on windows with privileges, *and* not using
DHCP but "ip-win32 netsh", *and* still using IPv4, then we install the
IPv4 address using no explicit "store=<nnn>" command - which defaults to
"permanent" (unlike "ip address add ..." on a unixoid system, which is
never persistent) - so the IPv4 address sticks across reboots.
First mistake... and then, on session end, we try to remove it with
"store=active" - which makes it go away *up to the next reboot*, and
then it's back, possibly interfering with future uses.
So this patch adds the "store=active" to the netsh.exe call inside
openvpn.exe for IPv4. This will fix it for all future assignments, but
not for "existing leftovers" - these will need to be fixed manually (once).
(One of the grand plans for 2.8 is "rip out all this from openvpn, only
support a single method, which is IPAPI via interactive service" - but
for 2.7 and 2.6, this is a bug that needs to be fixed short term)
The backport to 2.6 is trivial, though "cherrypick" does not work out of
the box due to the clang-reformat of the function call.
This said, I have not actually *tested* it, beyond "does it compile" - the
issue is clearly understood, the fix is clear, and it's just a string
change (as far as openvpn is concerned).
Your patch has been applied to the master and release/2.6 branch (bug).
commit 93c9b47cb0916c16ef76e6ecb5bf3f2ba7d267aa (master)
commit 3aacb621b56015f92cc0ae79987fa29c33842a2d (release/2.6)
Author: Lev Stipakov
Date: Wed Dec 10 08:59:00 2025 +0100
tun.c: set IPv4 address temporary on Windows
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1430
Message-Id: <20251210075906.27693-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34975.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
--
kind regards,
Gert Doering
diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 0299285..849eddc 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=active */ + argv_printf(&argv, "%s%s interface ip set address %lu static %s %s store=active", get_win_sys_path(), NETSH_PATH_SUFFIX, adapter_index, print_in_addr_t(ip, 0, &gc), print_in_addr_t(netmask, 0, &gc));