diff --git a/pkg/core/gvisorlocaltcphandler.go b/pkg/core/gvisorlocaltcphandler.go index fcdbf850..dc6e0182 100644 --- a/pkg/core/gvisorlocaltcphandler.go +++ b/pkg/core/gvisorlocaltcphandler.go @@ -6,6 +6,7 @@ import ( "gvisor.dev/gvisor/pkg/tcpip" "gvisor.dev/gvisor/pkg/tcpip/link/channel" "gvisor.dev/gvisor/pkg/tcpip/link/sniffer" + "gvisor.dev/gvisor/pkg/tcpip/stack" "gvisor.dev/gvisor/pkg/tcpip/transport/tcp" "github.com/wencaiwulue/kubevpn/v2/pkg/config" @@ -32,6 +33,9 @@ func handleGvisorPacket(gvisorInbound <-chan *Packet, outbound chan<- *Packet) * func (h *gvisorLocalTCPHandler) Run(ctx context.Context) { endpoint := channel.New(tcp.DefaultReceiveBufferSize, uint32(config.DefaultMTU), tcpip.GetRandMacAddr()) + // for support ipv6 skip checksum + // vendor/gvisor.dev/gvisor/pkg/tcpip/stack/nic.go:763 + endpoint.LinkEPCapabilities = stack.CapabilityRXChecksumOffload go func() { defer util.HandleCrash() readFromGvisorInboundWriteToEndpoint(ctx, h.gvisorInbound, endpoint) diff --git a/pkg/core/gvisortcphandler.go b/pkg/core/gvisortcphandler.go index 08906fb4..62eeaf15 100644 --- a/pkg/core/gvisortcphandler.go +++ b/pkg/core/gvisortcphandler.go @@ -10,6 +10,7 @@ import ( "gvisor.dev/gvisor/pkg/tcpip" "gvisor.dev/gvisor/pkg/tcpip/link/channel" "gvisor.dev/gvisor/pkg/tcpip/link/sniffer" + "gvisor.dev/gvisor/pkg/tcpip/stack" "gvisor.dev/gvisor/pkg/tcpip/transport/tcp" "github.com/wencaiwulue/kubevpn/v2/pkg/config" @@ -38,6 +39,9 @@ func (h *gvisorTCPHandler) Handle(ctx context.Context, tcpConn net.Conn) { func (h *gvisorTCPHandler) handle(ctx context.Context, tcpConn net.Conn) { endpoint := channel.New(tcp.DefaultReceiveBufferSize, uint32(config.DefaultMTU), tcpip.GetRandMacAddr()) + // for support ipv6 skip checksum + // vendor/gvisor.dev/gvisor/pkg/tcpip/stack/nic.go:763 + endpoint.LinkEPCapabilities = stack.CapabilityRXChecksumOffload errChan := make(chan error, 2) go func() { defer util.HandleCrash()