From c60ba6eaec1bf0609ab9f0aa7923847615d3889b Mon Sep 17 00:00:00 2001 From: Evgeny Date: Wed, 1 Jul 2026 17:57:36 +0300 Subject: [PATCH] tun: tun_init_nat always uses TUN_MTU_DEFAULT (1500), ignore ETCP mtu from config --- src/tun_if.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/tun_if.c b/src/tun_if.c index 98f1a421..e4fb8f13 100644 --- a/src/tun_if.c +++ b/src/tun_if.c @@ -223,7 +223,8 @@ fail: struct tun_if* tun_init_nat(struct UASYNC* ua, const char* ifname, const char* ip_addr_str, int mtu, int test_mode) { if (!ua || !ifname || !ip_addr_str) return NULL; - if (mtu <= 0) mtu = TUN_MTU_DEFAULT; + (void)mtu; + int tun_mtu = TUN_MTU_DEFAULT; struct tun_if* tun = u_calloc(1, sizeof(struct tun_if)); if (!tun) return NULL; @@ -238,7 +239,7 @@ struct tun_if* tun_init_nat(struct UASYNC* ua, const char* ifname, const char* i snprintf(ip_str, sizeof(ip_str), "%s/32", ip_addr_str); if (!test_mode) { - if (tun_platform_init(tun, tun->ifname, ip_str, mtu) != 0) { + if (tun_platform_init(tun, tun->ifname, ip_str, tun_mtu) != 0) { u_free(tun); return NULL; }