From: "cron2 (Code Review)" Date: Wed, 29 Oct 2025 07:22:25 +0000 In-Reply-To: References: Reply-To: gert@...1296..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: <8c2b25ed699a13aefeb4bd510c1be4a6915334cc-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="O5Kw7mfSplk="; 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 Cc: flichtenheld , openvpn-devel --O5Kw7mfSplk= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/13= 21?usp=3Demail ) 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(-) 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: merged 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 --O5Kw7mfSplk= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 sub= mitted this change.

View Change

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 Rog= ers <contact@...2949...>
Found-by: ZeroPath (https://zeropath.com/= )

Change-Id: I76eb584024610a6054a069340adbac988abf686c
Signed-off= -by: Arne Schwabe <arne-openvpn@...1227...>
Acked-by: Gert Doering= <gert@...1296...>
Gerrit URL: https://gerrit.openvpn.net/c/openvp= n/+/1321
Message-Id: <20251029065316.10182-1-gert@...1296...>
U= RL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg339= 89.html
Signed-off-by: Gert Doering <gert@...1296...>
---
M = src/openvpn/push.c
1 file changed, 14 insertions(+), 4 deletions(-)
<= br>
diff --git a/src/openvpn/push.c b/src/openvpn/push.c
ind= ex 6f146fc..7852d36 100644
--- a/src/openvpn/push.c<= br>+++ 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 tu= n
+ /* 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 tu= n device
*/
- if (strprefix(line, "peer-id ") || strpre= fix(line, "auth-token ")
- || strprefix(line, "auth-token-user "))<= /span>
+ if (strprefi= x(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 &= quot;)
+ |= | strprefix(line, "ping ")
+ || strprefix(line, "ping-restart ")<= /span>
+ || strpr= efix(line, "ping-timer "))
{
<= span> 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 change 1321. To unsubscribe, o= r for help writing mail filters, visit settings.

Gerrit-MessageType: merged
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>
= --O5Kw7mfSplk=--