From 8bfb64cf04bffd3fce197f104c38f2fa42cb8dec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 22 Mar 2024 14:49:51 +0800 Subject: [PATCH] Fix GSO batch size --- tun_linux.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tun_linux.go b/tun_linux.go index 46be8b7..bf95fbc 100644 --- a/tun_linux.go +++ b/tun_linux.go @@ -136,11 +136,13 @@ func (t *NativeTun) BatchSize() int { if !t.gsoEnabled { return 1 } + /* // Not works on some devices: https://github.com/SagerNet/sing-box/issues/1605 batchSize := int(gsoMaxSize/t.options.MTU) * 2 if batchSize > idealBatchSize { batchSize = idealBatchSize } - return batchSize + return batchSize*/ + return idealBatchSize } func (t *NativeTun) BatchRead(buffers [][]byte, offset int, readN []int) (n int, err error) {