]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Update fragment and mssfix related warnings
authorArne Schwabe <arne@rfc2549.org>
Thu, 10 Feb 2022 16:26:28 +0000 (17:26 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 13 Feb 2022 09:33:37 +0000 (10:33 +0100)
The warning that fragment/mssfix needs also tun-mtu set to 1500 makes
little sense. Remove it completely. Instead warn if there are
incosistencies
between --fragment and mssfix.

Patch v2: clarify the mssfix and fragment mtu warning message
Patch v4: Rebase

Signed-off-by: Arne Schwabe <arne@rfc2549.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20220210162632.3309974-4-arne@rfc2549.org>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23753.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/init.c

index 2b1b171343789dafc219a71f1ae71b17762c78cd..7c5e4ce13d67ec30b754021fe5b3c2c9cedd926d 100644 (file)
@@ -3184,12 +3184,17 @@ do_init_frame(struct context *c)
 #endif
 
 #ifdef ENABLE_FRAGMENT
-    if ((c->options.ce.mssfix || c->options.ce.fragment)
-        && c->c2.frame.tun_mtu != ETHERNET_MTU)
+    if (c->options.ce.fragment > 0 && c->options.ce.mssfix > c->options.ce.fragment)
     {
-        msg(M_WARN,
-            "WARNING: normally if you use --mssfix and/or --fragment, you should also set --tun-mtu %d (currently it is %d)",
-            ETHERNET_MTU, c->c2.frame.tun_mtu);
+        msg(M_WARN, "WARNING: if you use --mssfix and --fragment, you should "
+                    "set --fragment (%d) larger or equal than --mssfix (%d)",
+                    c->options.ce.fragment, c->options.ce.mssfix);
+    }
+    if (c->options.ce.fragment > 0 && c->options.ce.mssfix > 0
+        && c->options.ce.fragment_encap != c->options.ce.mssfix_encap)
+    {
+        msg(M_WARN, "WARNING: if you use --mssfix and --fragment, you should "
+                    "use the \"mtu\" flag for both or none of of them.");
     }
 #endif
 }