]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Clean up documentation for --tun-mtu-max
authorFrank Lichtenheld <frank@lichtenheld.com>
Sat, 23 Aug 2025 15:36:46 +0000 (17:36 +0200)
committerGert Doering <gert@greenie.muc.de>
Sat, 23 Aug 2025 15:40:56 +0000 (17:40 +0200)
There was some confusion about how the option
was called...

Change-Id: I5e240c35cd4236e1d845195e4634fd5008f61814
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20250823153652.30938-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg32663.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
doc/man-sections/vpn-network-options.rst
src/openvpn/init.c
src/openvpn/mtu.h
src/openvpn/options.c
src/openvpn/push.c

index 4a64e8d0508a6c87f17750f37aff1fef0af6c302..2a06ef61262449d339e75c9be3033f528ec89952 100644 (file)
@@ -587,7 +587,7 @@ routing.
   packets larger than ``tun-mtu`` (e.g. Linux and FreeBSD) but other platforms
   (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 1600
index 55832745fec6136b2d568cea662c262f35c0f927..9dd3b966b3fa99a4020b0f94ab3e64d1c2da97ce 100644 (file)
@@ -2916,7 +2916,7 @@ frame_finalize_options(struct context *c, const struct options *o)
 
     /* We always allow at least 1600 MTU packets to be received in our buffer
      * space to allow server to push "baby giant" MTU sizes */
-    frame->tun_max_mtu = max_int(1600, frame->tun_max_mtu);
+    frame->tun_max_mtu = max_int(TUN_MTU_MAX_MIN, frame->tun_max_mtu);
 
     size_t payload_size = frame->tun_max_mtu;
 
index 925ef0bfa3436eef9ebd8bd8e1a13ab55581dbb1..c092461d0d5cb7014beb3d34c7858693a038b2ec 100644 (file)
  */
 #define TUN_MTU_DEFAULT 1500
 
+/*
+ * Minimum maximum MTU
+ */
+#define TUN_MTU_MAX_MIN 1600
+
 /*
  * MTU Defaults for TAP devices
  */
index e9584a82967652e0d9a31e195a90f6f3063b0358..0b16c5a3f32f4fd47c1e21e17e35f33c1222dc0d 100644 (file)
@@ -297,6 +297,7 @@ static const char usage_message[] =
     "--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=0 TAP=%d).\n"
+    "--tun-mtu-max n : Maximum pushable MTU (default and minimum=%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 @@ usage(void)
 
     fprintf(fp, usage_message, title_string, o.ce.connect_retry_seconds,
             o.ce.connect_retry_seconds_max, o.ce.local_port, o.ce.remote_port, TUN_MTU_DEFAULT,
-            TAP_MTU_EXTRA_DEFAULT, o.verbosity, o.authname, o.replay_window, o.replay_time,
-            o.tls_timeout, o.renegotiate_seconds, o.handshake_window, o.transition_window);
+            TAP_MTU_EXTRA_DEFAULT, TUN_MTU_MAX_MIN, o.verbosity, 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 @@ add_option(struct options *options, char *p[], bool is_inline, const char *file,
             options->ce.occ_mtu = 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 = positive_atoi(p[1], msglevel);
index 889b26832b61cd8b1bede248e72abb6b966f21ae..4f6adfce4625a9be52e4c9aa4d254435b89f1fb6 100644 (file)
@@ -721,7 +721,7 @@ prepare_push_reply(struct context *c, struct gc_arena *gc, struct push_list *pus
         {
             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);
         }