From: "cron2 (Code Review)" Date: Sat, 23 Aug 2025 15:43:32 +0000 In-Reply-To: References: Reply-To: gert@...1296..., 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="Et09z3WkXFE="; charset=UTF-8 Subject: [Openvpn-devel] [S] Change in openvpn[master]: Clean up documentation for --tun-mtu-max List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: flichtenheld , plaisthos Cc: openvpn-devel --Et09z3WkXFE= 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= flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1152?usp=3Demail ) The following approvals got outdated and were removed: Code-Review+2 by cron2 Change subject: Clean up documentation for --tun-mtu-max ...................................................................... Clean up documentation for --tun-mtu-max There was some confusion about how the option was called... Change-Id: I5e240c35cd4236e1d845195e4634fd5008f61814 Signed-off-by: Frank Lichtenheld Acked-by: Gert Doering Message-Id: <20250823153652.30938-1-gert@...1296...> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32= 663.html Signed-off-by: Gert Doering --- M doc/man-sections/vpn-network-options.rst M src/openvpn/init.c M src/openvpn/mtu.h M src/openvpn/options.c M src/openvpn/push.c 5 files changed, 13 insertions(+), 6 deletions(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/52/1152/2 diff --git a/doc/man-sections/vpn-network-options.rst b/doc/man-sections/vp= n-network-options.rst index 4a64e8d..2a06ef6 100644 --- a/doc/man-sections/vpn-network-options.rst +++ b/doc/man-sections/vpn-network-options.rst @@ -587,7 +587,7 @@ packets larger than ``tun-mtu`` (e.g. Linux and FreeBSD) but other platf= orms (like macOS) limit received packets to the same size as the MTU. ---tun-max-mtu maxmtu +--tun-mtu-max maxmtu This configures the maximum MTU size that a server can push to ``maxmtu`= `, by configuring the internal buffers to allow at least this packet size. The default for ``maxmtu`` is 1600. Currently, only increasing beyond 16= 00 diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 5583274..9dd3b96 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -2916,7 +2916,7 @@ /* We always allow at least 1600 MTU packets to be received in our buf= fer * space to allow server to push "baby giant" MTU sizes */ - frame->tun_max_mtu =3D max_int(1600, frame->tun_max_mtu); + frame->tun_max_mtu =3D max_int(TUN_MTU_MAX_MIN, frame->tun_max_mtu); size_t payload_size =3D frame->tun_max_mtu; diff --git a/src/openvpn/mtu.h b/src/openvpn/mtu.h index 925ef0b..c092461 100644 --- a/src/openvpn/mtu.h +++ b/src/openvpn/mtu.h @@ -69,6 +69,11 @@ #define TUN_MTU_DEFAULT 1500 /* + * Minimum maximum MTU + */ +#define TUN_MTU_MAX_MIN 1600 + +/* * MTU Defaults for TAP devices */ #define TAP_MTU_EXTRA_DEFAULT 32 diff --git a/src/openvpn/options.c b/src/openvpn/options.c index e9584a8..0b16c5a 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -297,6 +297,7 @@ "--tun-mtu-extra n : Assume that tun/tap device might return as many\n" " as n bytes more than the tun-mtu size on read\n" " (default TUN=3D0 TAP=3D%d).\n" + "--tun-mtu-max n : Maximum pushable MTU (default and minimum=3D%d).\n" "--link-mtu n : Take the TCP/UDP device MTU to be n and derive the = tun MTU\n" " from it.\n" "--mtu-disc type : Should we do Path MTU discovery on TCP/UDP channel?= \n" @@ -4844,8 +4845,9 @@ fprintf(fp, usage_message, title_string, o.ce.connect_retry_seconds, o.ce.connect_retry_seconds_max, o.ce.local_port, o.ce.remote_p= ort, TUN_MTU_DEFAULT, - TAP_MTU_EXTRA_DEFAULT, o.verbosity, o.authname, o.replay_windo= w, o.replay_time, - o.tls_timeout, o.renegotiate_seconds, o.handshake_window, o.tr= ansition_window); + TAP_MTU_EXTRA_DEFAULT, TUN_MTU_MAX_MIN, o.verbosity, o.authnam= e, o.replay_window, + o.replay_time, o.tls_timeout, o.renegotiate_seconds, o.handsha= ke_window, + o.transition_window); fflush(fp); #endif /* ENABLE_SMALL */ @@ -7011,7 +7013,7 @@ options->ce.occ_mtu =3D 0; } } - else if (streq(p[0], "tun-mtu-max") && p[1] && !p[3]) + else if (streq(p[0], "tun-mtu-max") && p[1] && !p[2]) { VERIFY_PERMISSION(OPT_P_MTU | OPT_P_CONNECTION); int max_mtu =3D positive_atoi(p[1], msglevel); diff --git a/src/openvpn/push.c b/src/openvpn/push.c index 889b268..4f6adfc 100644 --- a/src/openvpn/push.c +++ b/src/openvpn/push.c @@ -721,7 +721,7 @@ { msg(M_WARN, "Warning: reported maximum MTU from client (%d) is lower " - "than MTU used on the server (%d). Add tun-max-mtu %d " + "than MTU used on the server (%d). Add tun-mtu-max %d " "to client configuration.", client_max_mtu, o->ce.tun_mtu, o->ce.tun_mtu); } -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/1152?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I5e240c35cd4236e1d845195e4634fd5008f61814 Gerrit-Change-Number: 1152 Gerrit-PatchSet: 2 Gerrit-Owner: flichtenheld Gerrit-Reviewer: cron2 Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-MessageType: newpatchset --Et09z3WkXFE= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

cron2 uploaded patch set #2 to the change originally cr= eated by flichtenheld.

View Change

The following approvals got outd= ated and were removed: Code-Review+2 by cron2

Clean up documentation for --tun-mtu-max

Ther= e was some confusion about how the option
was called...

Change-Id= : I5e240c35cd4236e1d845195e4634fd5008f61814
Signed-off-by: Frank Lichten= held <frank@...2641...>
Acked-by: Gert Doering <gert@...1296...= >
Message-Id: <20250823153652.30938-1-gert@...1296...>
URL: = https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32663.h= tml
Signed-off-by: Gert Doering <gert@...1296...>
---
M doc/= man-sections/vpn-network-options.rst
M src/openvpn/init.c
M src/openv= pn/mtu.h
M src/openvpn/options.c
M src/openvpn/push.c
5 files chan= ged, 13 insertions(+), 6 deletions(-)

git pull ssh://gerrit.openv=
pn.net:29418/openvpn refs/changes/52/1152/2
diff --git a/doc/man-se=
ctions/vpn-network-options.rst b/doc/man-sections/vpn-network-options.rst
index 4a64e8d..2a06ef6 100644
--- a/doc/man-= sections/vpn-network-options.rst
+++ b/doc/man-sections/vpn= -network-options.rst
@@ -587,7 +587,7 @@
= packets larger than ``tun-mtu`` (e.g. Linux and FreeBSD) but other platfor= ms
(like macOS) limit received packets to the same size = as the MTU.

---tun-max-mtu maxmtu<= br>+--tun-mtu-max maxmtu=
This configures the maximum MTU size that a server can push to= ``maxmtu``,
by configuring the internal buffers to allo= w at least this packet size.
The default for ``maxmtu`` = is 1600. Currently, only increasing beyond 1600
diff --git = a/src/openvpn/init.c b/src/openvpn/init.c
index 5583274..9d= d3b96 100644
--- a/src/openvpn/init.c
+++ b= /src/openvpn/init.c
@@ -2916,7 +2916,7 @@
=
/* We always allow at least 1600 MTU packets to be re= ceived in our buffer
* space to allow server to push = "baby giant" MTU sizes */
- frame->tun_max_mtu =3D max_int(1600, frame->tun_max= _mtu);
+ frame->= ;tun_max_mtu =3D max_int(TUN_MTU_MAX_MIN, frame->tun_max_mtu);
size_t payload_size =3D frame->tun_max_mtu= ;

diff --git a/src/openvpn/mtu.h b/src/op= envpn/mtu.h
index 925ef0b..c092461 100644
-= -- a/src/openvpn/mtu.h
+++ b/src/openvpn/mtu.h
@@ -69,6 +69,11 @@

#define TUN_MTU_DEFAULT 1500=

/*
+ * Minimum maximum MTU
+ */
+#= define TUN_MTU_MAX_MIN 1600
+
+/* * MTU Defaults for TAP devices
*/
#define TAP_MTU_EXTRA_DEFAULT 32
diff --git a/src/openv= pn/options.c b/src/openvpn/options.c
index e9584a8..0b16c5a= 100644
--- a/src/openvpn/options.c
+++ b/s= rc/openvpn/options.c
@@ -297,6 +297,7 @@
= "--tun-mtu-extra n : Assume that tun/tap device might return as man= y\n"
" as n bytes more than= the tun-mtu size on read\n"
" = (default TUN=3D0 TAP=3D%d).\n"
+ "--tun-mtu-max n : Maximum pushable MTU (defau= lt and minimum=3D%d).\n"
"--link-mtu n : = Take the TCP/UDP device MTU to be n and derive the tun MTU\n" " from it.\n"
= "--mtu-disc type : Should we do Path MTU discovery on TCP/UDP channel?= \n"
@@ -4844,8 +4845,9 @@

= fprintf(fp, usage_message, title_string, o.ce.connect_retry_seco= nds,
o.ce.connect_retry_seconds_max, o.ce.loca= l_port, o.ce.remote_port, TUN_MTU_DEFAULT,
- TAP_MTU_EXTRA_DEFAULT, o.verbosity, o.auth= name, o.replay_window, o.replay_time,
- o.tls_timeout, o.renegotiate_seconds, o.handsha= ke_window, o.transition_window);
+ TAP_MTU_EXTRA_DEFAULT, TUN_MTU_MAX_MIN, o.verbosit= y, o.authname, o.replay_window,
+ o.replay_time, o.tls_timeout, o.renegotiate_seconds= , o.handshake_window,
+ o.transition_window);
fflush(fp);=

#endif /= * ENABLE_SMALL */
@@ -7011,7 +7013,7 @@
= options->ce.occ_mtu =3D 0;
} }
- els= e if (streq(p[0], "tun-mtu-max") && p[1] && !p[3]= )
+ else if (streq= (p[0], "tun-mtu-max") && p[1] && !p[2]) {
VERIFY_PERMISSION(OPT_P_MTU | OPT_P_= CONNECTION);
int max_mtu =3D positive_atoi(p[1], m= sglevel);
diff --git a/src/openvpn/push.c b/src/openvpn/pus= h.c
index 889b268..4f6adfc 100644
--- a/src= /openvpn/push.c
+++ b/src/openvpn/push.c
@@= -721,7 +721,7 @@
{
m= sg(M_WARN,
"Warning: reported maximum= MTU from client (%d) is lower "
- "than MTU used on the server (%d). Add= tun-max-mtu %d "
change 1152. To unsubscribe, or for help writing mail filte= rs, visit settings.

<= div itemscope itemtype=3D"http://schema.org/EmailMessage">
<= meta itemprop=3D"name" content=3D"View Change"/>
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5e240c35cd4236e1d845195e463= 4fd5008f61814
Gerrit-Change-Number: 1152
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: cron2 <gert@...1296...>=
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-MessageType: newpatchset
--Et09z3WkXFE=--