From: "plaisthos (Code Review)" Date: Mon, 27 Oct 2025 22:37:36 +0000 References: Reply-To: arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net, frank@...2641... Message-ID: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="Y/miYUwUnK0="; 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: flichtenheld Cc: openvpn-devel --Y/miYUwUnK0= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: flichtenheld. Hello flichtenheld, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/1321?usp=3Demail to review the following change. 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: contact@...2949... Found-By: Zeropath Change-Id: I76eb584024610a6054a069340adbac988abf686c --- M src/openvpn/push.c 1 file changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/21/1321/1 diff --git a/src/openvpn/push.c b/src/openvpn/push.c index 2c717c7..d7063e6 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -1025,15 +1025,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: newchange Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I76eb584024610a6054a069340adbac988abf686c Gerrit-Change-Number: 1321 Gerrit-PatchSet: 1 Gerrit-Owner: plaisthos Gerrit-Reviewer: flichtenheld Gerrit-CC: openvpn-devel Gerrit-Attention: flichtenheld --Y/miYUwUnK0= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is cur= rently required from: flichtenheld.

plaisthos would like flichtenheld to review this change.

V= iew Change

Fix logic when pushed cipher triggers tun r=
eopen 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 shoul= d not trigger a reopen of tun
in push message.

Reported-By: conta= ct@...2949...
Found-By: Zeropath
Change-Id: I76eb584024610a6054a06934= 0adbac988abf686c
---
M src/openvpn/push.c
1 file changed, 14 inser= tions(+), 4 deletions(-)

git pull ssh://gerrit.o=
penvpn.net:29418/openvpn refs/changes/21/1321/1
diff --git a/src/op=
envpn/push.c b/src/openvpn/push.c
index 2c717c7..d7063e6 10= 0644
--- a/src/openvpn/push.c
+++ b/src/ope= nvpn/push.c
@@ -1025,15 +1025,25 @@
ch= ar line[OPTION_PARM_SIZE];
while (buf_parse(buf, '= ,', line, sizeof(line)))
{
- /* peer-id and auth-token might cha= nge on restart and this should not trigger reopening tun
+ /* peer-id and auth-token migh= t change on restart and this should not
+ * trigger reopening tun
+ * Also other options that only a= ffect 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-us= er")
+ = || strprefix(line, "protocol-flags ")
+ || strprefix(line, "key-deri= vation ")
+ = || strprefix(line, "explicit-exit-notify ")
+ || strprefix(line, &qu= ot;ping ")
+ = || strprefix(line, "ping-restart ")
+ || strprefix(line, "ping= -timer "))
{
con= tinue;
}
/* tun reopen on= ly 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, or for help writing ma= il filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I76eb584024610a6054a069340ad= bac988abf686c
Gerrit-Change-Number: 1321
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <arne-openvpn@...1711...= 27...>
Gerrit-Reviewer: flichtenheld <frank@...2716...= 1...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: flichtenheld <frank@...2375...= 41...>
= --Y/miYUwUnK0=--