From: Arne Schwabe Date: Tue, 7 Dec 2021 17:01:56 +0000 (+0100) Subject: Remove post_open_mtu code X-Git-Tag: v2.6_beta1~347 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c27868bfc2ad6ee21c28f4addb1c2fc003bfa61a;p=thirdparty%2Fopenvpn.git Remove post_open_mtu code This code is probably from a time when we could not set the MTU on the Windows tap6 driver. Nowadays we can set the MTU on this device, so this code is a noop now. Signed-off-by: Arne Schwabe Acked-by: Gert Doering Message-Id: <20211207170211.3275837-7-arne@rfc2549.org> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg23327.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 92000b004..3049fa16d 100644 --- a/src/openvpn/init.c +++ b/src/openvpn/init.c @@ -1873,16 +1873,6 @@ do_open_tun(struct context *c) c->c1.tuntap, c->plugins, c->c2.es, &c->net_ctx); } - /* - * Did tun/tap driver give us an MTU? - */ - if (c->c1.tuntap->post_open_mtu) - { - frame_set_mtu_dynamic(&c->c2.frame, - c->c1.tuntap->post_open_mtu, - SET_MTU_TUN | SET_MTU_UPPER_BOUND); - } - ret = true; static_context = c; #ifndef TARGET_ANDROID diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c index 75d5eaf7b..12bdd2005 100644 --- a/src/openvpn/tun.c +++ b/src/openvpn/tun.c @@ -6071,7 +6071,6 @@ tuntap_get_mtu(struct tuntap *tt) &mtu, sizeof(mtu), &mtu, sizeof(mtu), &len, NULL)) { - tt->post_open_mtu = (int)mtu; msg(D_MTU_INFO, "TAP-Windows MTU=%d", (int)mtu); } } diff --git a/src/openvpn/tun.h b/src/openvpn/tun.h index aa1e47b5a..d4657537c 100644 --- a/src/openvpn/tun.h +++ b/src/openvpn/tun.h @@ -214,10 +214,6 @@ struct tuntap #endif /* used for printing status info only */ unsigned int rwflags_debug; - - /* Some TUN/TAP drivers like to be ioctled for mtu - * after open */ - int post_open_mtu; }; static inline bool