Skip to content

Commit

Permalink
Fix GSO batch size
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Mar 22, 2024
1 parent 689e608 commit 8bfb64c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tun_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8bfb64c

Please sign in to comment.