Reduce default MTU for android

This commit is contained in:
世界 2025-08-13 11:48:44 +08:00
parent a65d3e040a
commit c0ac3c748c
No known key found for this signature in database
GPG Key ID: CD109927C34A63C4

View File

@ -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
}