From 28e668b2f343039534fa3c0b2e0ea211c407e33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sat, 30 Sep 2023 22:20:33 +0800 Subject: [PATCH] Update gVisor to 20230814.0 --- go.mod | 2 +- go.sum | 4 ++-- tun_darwin_gvisor.go | 4 ++++ tun_windows_gvisor.go | 4 ++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index dec5211..b04651a 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/fsnotify/fsnotify v1.6.0 github.com/go-ole/go-ole v1.3.0 github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61 - github.com/sagernet/gvisor v0.0.0-20230627031050-1ab0276e0dd2 + github.com/sagernet/gvisor v0.0.0-20230930141345-5fef6f2e17ab github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 github.com/sagernet/sing v0.2.12 github.com/scjalliance/comshim v0.0.0-20230315213746-5e51f40bd3b9 diff --git a/go.sum b/go.sum index ba7a0a4..ef151b6 100644 --- a/go.sum +++ b/go.sum @@ -6,8 +6,8 @@ github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61 h1:5+m7c6AkmAylhauulqN/c5dnh8/KssrE9c93TQrXldA= github.com/sagernet/go-tun2socks v1.16.12-0.20220818015926-16cb67876a61/go.mod h1:QUQ4RRHD6hGGHdFMEtR8T2P6GS6R3D/CXKdaYHKKXms= -github.com/sagernet/gvisor v0.0.0-20230627031050-1ab0276e0dd2 h1:dnkKrzapqtAwjTSWt6hdPrARORfoYvuUczynvRLrueo= -github.com/sagernet/gvisor v0.0.0-20230627031050-1ab0276e0dd2/go.mod h1:1JUiV7nGuf++YFm9eWZ8q2lrwHmhcUGzptMl/vL1+LA= +github.com/sagernet/gvisor v0.0.0-20230930141345-5fef6f2e17ab h1:u+xQoi/Yc6bNUvTfrDD6HhGRybn2lzrhf5vmS+wb4Ho= +github.com/sagernet/gvisor v0.0.0-20230930141345-5fef6f2e17ab/go.mod h1:3akUhSHSVtLuJaYcW5JPepUraBOW06Ibz2HKwaK5rOk= github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97 h1:iL5gZI3uFp0X6EslacyapiRz7LLSJyr4RajF/BhMVyE= github.com/sagernet/netlink v0.0.0-20220905062125-8043b4a9aa97/go.mod h1:xLnfdiJbSp8rNqYEdIW/6eDO4mVoogml14Bh2hSiFpM= github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY= diff --git a/tun_darwin_gvisor.go b/tun_darwin_gvisor.go index 85e3a62..132d0c3 100644 --- a/tun_darwin_gvisor.go +++ b/tun_darwin_gvisor.go @@ -105,6 +105,10 @@ func (e *DarwinEndpoint) ARPHardwareType() header.ARPHardwareType { func (e *DarwinEndpoint) AddHeader(buffer stack.PacketBufferPtr) { } +func (e *DarwinEndpoint) ParseHeader(ptr stack.PacketBufferPtr) bool { + return true +} + func (e *DarwinEndpoint) WritePackets(packetBufferList stack.PacketBufferList) (int, tcpip.Error) { var n int for _, packet := range packetBufferList.AsSlice() { diff --git a/tun_windows_gvisor.go b/tun_windows_gvisor.go index b474df0..49ad60f 100644 --- a/tun_windows_gvisor.go +++ b/tun_windows_gvisor.go @@ -102,6 +102,10 @@ func (e *WintunEndpoint) ARPHardwareType() header.ARPHardwareType { func (e *WintunEndpoint) AddHeader(buffer stack.PacketBufferPtr) { } +func (e *WintunEndpoint) ParseHeader(ptr stack.PacketBufferPtr) bool { + return true +} + func (e *WintunEndpoint) WritePackets(packetBufferList stack.PacketBufferList) (int, tcpip.Error) { var n int for _, packet := range packetBufferList.AsSlice() {