From: Arne Schwabe Date: Thu, 10 Feb 2022 17:26:28 +0100 Message-Id: <20220210162632.3309974-4-arne@...1227...> In-Reply-To: <20220210162632.3309974-1-arne@...1227...> References: <20220210162632.3309974-1-arne@...1227...> MIME-Version: 1.0 Subject: [Openvpn-devel] [PATCH v4 4/8] Update fragment and mssfix related warnings List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: openvpn-devel@lists.sourceforge.net 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 --- src/openvpn/init.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index b9c3e166..b1952f46 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -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 } -- 2.33.0