From c0ac3c748ceaf09f387fed246204a1535b03e5ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 13 Aug 2025 11:48:44 +0800 Subject: [PATCH] Reduce default MTU for android --- protocol/tun/inbound.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/protocol/tun/inbound.go b/protocol/tun/inbound.go index e018b642..fc69309c 100644 --- a/protocol/tun/inbound.go +++ b/protocol/tun/inbound.go @@ -137,6 +137,9 @@ func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLo if platformInterface != nil && platformInterface.UnderNetworkExtension() { // In Network Extension, when MTU exceeds 4064 (4096-UTUN_IF_HEADROOM_SIZE), the performance of tun will drop significantly, which may be a system bug. tunMTU = 4064 + } else if C.IsAndroid { + // Some Android devices report ENOBUFS when using MTU 65535 + tunMTU = 9000 } else { tunMTU = 65535 }