From: "cron2 (Code Review)" Date: Wed, 29 Oct 2025 07:22:22 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <8c2b25ed699a13aefeb4bd510c1be4a6915334cc-EmailReplacePatchSet-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="60PKkDYb0Ww="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Fix logic when pushed cipher triggers tun reopen and ignore more options List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos , flichtenheld Cc: openvpn-devel --60PKkDYb0Ww= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has uploaded a new patch set (#2) to the change originally created by= plaisthos. ( http://gerrit.openvpn.net/c/openvpn/+/1321?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: Fix logic when pushed cipher triggers tun reopen and ignore= more options ...................................................................... Fix logic when pushed cipher triggers tun reopen and ignore more options The logic was inverted. Only when link-mtu is used, pushing a cipher can change the MTU and not the other way round. (found by zeropath) Also ignore a few more options that should not trigger a reopen of tun in push message. Reported-by: Joshua Rogers Found-by: ZeroPath (https://zeropath.com/) Change-Id: I76eb584024610a6054a069340adbac988abf686c Signed-off-by: Arne Schwabe Acked-by: Gert Doering Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1321 Message-Id: <20251029065316.10182-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33= 989.html Signed-off-by: Gert Doering --- M src/openvpn/push.c 1 file changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/1321/2 diff --git a/src/openvpn/push.c b/src/openvpn/push.c index 6f146fc..7852d36 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -1029,15 +1029,25 @@ char line[OPTION_PARM_SIZE]; while (buf_parse(buf, ',', line, sizeof(line))) { - /* peer-id and auth-token might change on restart and this should = not trigger reopening tun + /* peer-id and auth-token might change on restart and this should = not + * trigger reopening tun + * Also other options that only affect the control channel should + * not trigger a reopen of the tun device */ - if (strprefix(line, "peer-id ") || strprefix(line, "auth-token ") - || strprefix(line, "auth-token-user ")) + if (strprefix(line, "peer-id ") + || strprefix(line, "auth-token ") + || strprefix(line, "auth-token-user") + || strprefix(line, "protocol-flags ") + || strprefix(line, "key-derivation ") + || strprefix(line, "explicit-exit-notify ") + || strprefix(line, "ping ") + || strprefix(line, "ping-restart ") + || strprefix(line, "ping-timer ")) { continue; } /* tun reopen only needed if cipher change can change tun MTU */ - if (strprefix(line, "cipher ") && !opt->ce.tun_mtu_defined) + if (strprefix(line, "cipher ") && opt->ce.tun_mtu_defined) { continue; } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1321?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings?usp=3Demail Gerrit-MessageType: newpatchset Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I76eb584024610a6054a069340adbac988abf686c Gerrit-Change-Number: 1321 Gerrit-PatchSet: 2 Gerrit-Owner: plaisthos Gerrit-Reviewer: cron2 Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel --60PKkDYb0Ww= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 upl= oaded patch set #2 to the change originally created by plaisthos.<= /p>

Vi= ew Change

The following approvals got outdated and were removed: Code-Review+2 by cron2

Fix logic when pushed cipher trigge=
rs tun reopen and ignore more options

The logic was inverted. Only w= hen link-mtu is used, pushing a cipher can
change the MTU and not the ot= her way round. (found by zeropath)

Also ignore a few more options th= at should not trigger a reopen of tun
in push message.

Reported-b= y: Joshua Rogers <contact@...2949...>
Found-by: ZeroPath (https://= zeropath.com/)

Change-Id: I76eb584024610a6054a069340adbac988abf686c<= br>Signed-off-by: Arne Schwabe <arne-openvpn@...1227...>
Acked-by:= Gert Doering <gert@...1296...>
Gerrit URL: https://gerrit.openvpn= .net/c/openvpn/+/1321
Message-Id: <20251029065316.10182-1-gert@...1826...= 6...>
URL: https://www.mail-archive.com/openvpn-devel@...1768...= ge.net/msg33989.html
Signed-off-by: Gert Doering <gert@...1296...>=
---
M src/openvpn/push.c
1 file changed, 14 insertions(+), 4 dele= tions(-)

git pull ssh://gerrit.openvpn.net:29418=
/openvpn refs/changes/21/1321/2
diff --git a/src/openvpn/push.c b/s=
rc/openvpn/push.c
index 6f146fc..7852d36 100644
<= span>--- a/src/openvpn/push.c
+++ b/src/openvpn/push.c
@@ -1029,15 +1029,25 @@
char line[OPTION_P= ARM_SIZE];
while (buf_parse(buf, ',', line, si= zeof(line)))
{
- /* peer-id and auth-token might change on restart and= this should not trigger reopening tun
+ /* peer-id and auth-token might change on restar= t and this should not
+ * trigger reopening tun
+ * Also other options that only affect the control c= hannel should
+ = * not trigger a reopen of the tun device
*/
- if (strprefix(li= ne, "peer-id ") || strprefix(line, "auth-token ")
- || strprefix(li= ne, "auth-token-user "))
+ if (strprefix(line, "peer-id ")
= + || strprefix(line,= "auth-token ")
+ || strprefix(line, "auth-token-user")+ || strprefix(line= , "protocol-flags ")
+ || strprefix(line, "key-derivation ")
+ || strprefix= (line, "explicit-exit-notify ")
+ || strprefix(line, "ping ")
+ || strprefi= x(line, "ping-restart ")
+ || strprefix(line, "ping-timer "))
{
continue;
}

/* tun reopen only needed if cipher= change can change tun MTU */
- if (strprefix(line, "cipher ") && !opt-&g= t;ce.tun_mtu_defined)
+ if (strprefix(line, "cipher ") && opt->ce.tu= n_mtu_defined)
{
cont= inue;
}

To vie= w, visit change 1321. To unsubscribe, or for help writing mail filters, visit <= a href=3D"http://gerrit.openvpn.net/settings?usp=3Demail">settings.

=
<= meta itemprop=3D"name" content=3D"View Change"/>
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I76eb584024610a6054a069340ad= bac988abf686c
Gerrit-Change-Number: 1321
Gerrit-PatchSet: 2
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
= --60PKkDYb0Ww=--