Improve darwin tun performance

This commit is contained in:
世界 2025-07-17 17:33:41 +08:00
parent 7812930a48
commit aa1fd4d994
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
16 changed files with 192 additions and 115 deletions

8
tun.go
View file

@ -25,7 +25,6 @@ type Handler interface {
type Tun interface {
io.ReadWriter
N.VectorisedWriter
Name() (string, error)
Start() error
Close() error
@ -97,6 +96,13 @@ type Options struct {
// For library usages.
EXP_DisableDNSHijack bool
// For gvisor stack, it should be enabled when MTU is less than 32768; otherwise it should be less than or equal to 8192.
// The above condition is just an estimate and not exact, calculated on M4 pro.
EXP_MultiPendingPackets bool
// Will cause the darwin network to die, do not use.
EXP_SendMsgX bool
}
func (o *Options) Inet4GatewayAddr() netip.Addr {