mirror of
https://github.com/SagerNet/sing-box.git
synced 2026-11-10 21:21:02 +08:00
Fix GSO frames with more segments than a TUN read batch
This commit is contained in:
5 files changed
+4
-11
No files matched your search
@@ -55,7 +55,7 @@ require (
|
||||
github.com/sagernet/sing-shadowsocks2 v0.2.2-0.20260929152114-a69d1086332b
|
||||
github.com/sagernet/sing-shadowtls v0.2.2-0.20260928201441-a9c0127d5c99
|
||||
github.com/sagernet/sing-snell v0.0.0-20261109120040-72a9d48fcda7
|
||||
github.com/sagernet/sing-tun v0.9.7-0.20261109102115-27e188fc90f4
|
||||
github.com/sagernet/sing-tun v0.9.7-0.20261109145621-cb941cc824bf
|
||||
github.com/sagernet/sing-usbip v0.0.0-20260817040617-28bd42667eca
|
||||
github.com/sagernet/sing-vmess v0.2.9-0.20261108133243-b01463cef941
|
||||
github.com/sagernet/smux v1.5.50-sing-box-mod.1
|
||||
|
||||
@@ -338,8 +338,8 @@ github.com/sagernet/sing-shadowtls v0.2.2-0.20260928201441-a9c0127d5c99 h1:l/tdZ
|
||||
github.com/sagernet/sing-shadowtls v0.2.2-0.20260928201441-a9c0127d5c99/go.mod h1:sWqKnGlMipCHaGsw1sTTlimyUpgzP4WP3pjhCsYt9oA=
|
||||
github.com/sagernet/sing-snell v0.0.0-20261109120040-72a9d48fcda7 h1:nMJkYrwTWM5Cor1kBxGEUBoRNM2JMlLZ+nsAEOPkekE=
|
||||
github.com/sagernet/sing-snell v0.0.0-20261109120040-72a9d48fcda7/go.mod h1:et8Lws4f5QbOrY65DmjevHGup3mijJkhswkto6cwciM=
|
||||
github.com/sagernet/sing-tun v0.9.7-0.20261109102115-27e188fc90f4 h1:Bq+ROKWqroxToGY7GczLpgjTUZAcHTwDRJ6JlkSMPR4=
|
||||
github.com/sagernet/sing-tun v0.9.7-0.20261109102115-27e188fc90f4/go.mod h1:3EgPst7agntRO7D6GOsiZ1l9FoqdLeuWmKT5TnWkmf0=
|
||||
github.com/sagernet/sing-tun v0.9.7-0.20261109145621-cb941cc824bf h1:pdEaH7rHVxZzB15rEEFTkoFs2bcu2Z91VrPlpl6jBKQ=
|
||||
github.com/sagernet/sing-tun v0.9.7-0.20261109145621-cb941cc824bf/go.mod h1:3EgPst7agntRO7D6GOsiZ1l9FoqdLeuWmKT5TnWkmf0=
|
||||
github.com/sagernet/sing-usbip v0.0.0-20260817040617-28bd42667eca h1:5wA+IE0Fq1CGVLOgSpm0gKKZ03HzugcJ2JyhmDqeX6A=
|
||||
github.com/sagernet/sing-usbip v0.0.0-20260817040617-28bd42667eca/go.mod h1:ADAZZU85MnM91XNhd2TdZRTaIbA7RjTZuQ1KCHcUbNg=
|
||||
github.com/sagernet/sing-vmess v0.2.9-0.20261108133243-b01463cef941 h1:QiLfQ/yZwOV0Guu/Yxeqf8QTwlPi2gVQyirU5BqJjOM=
|
||||
|
||||
@@ -347,7 +347,7 @@ func (b *backendLinux) batchReadLoop() {
|
||||
if !tun.IsRecoverableReadError(err) {
|
||||
return
|
||||
}
|
||||
readRetry.Wait(err)
|
||||
readRetry.Wait()
|
||||
} else {
|
||||
readRetry.Reset()
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ package tailscale
|
||||
|
||||
import (
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"io"
|
||||
"os"
|
||||
"sync"
|
||||
@@ -75,9 +74,6 @@ func (a *tunDeviceAdapter) Read(bufs [][]byte, sizes []int, offset int) (count i
|
||||
a.debugPacket("read", readBuf[singTun.PacketOffset:n])
|
||||
return 1, nil
|
||||
}
|
||||
if errors.Is(err, singTun.ErrTooManySegments) {
|
||||
err = wgTun.ErrTooManySegments
|
||||
}
|
||||
return 0, err
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package wireguard
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"net"
|
||||
"net/netip"
|
||||
"os"
|
||||
@@ -137,8 +136,6 @@ func (w *systemDevice) Read(bufs [][]byte, sizes []int, offset int) (count int,
|
||||
if err == nil {
|
||||
sizes[0] -= tun.PacketOffset
|
||||
count = 1
|
||||
} else if errors.Is(err, tun.ErrTooManySegments) {
|
||||
err = wgTun.ErrTooManySegments
|
||||
}
|
||||
}
|
||||
return
|
||||
|
||||
Reference in new issue
Block a user