mirror of
https://github.com/kubenetworks/kubevpn.git
synced 2025-09-26 19:31:17 +08:00
hotfix: ipv6 skip checksum verification (#682)
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
|||||||
"gvisor.dev/gvisor/pkg/tcpip"
|
"gvisor.dev/gvisor/pkg/tcpip"
|
||||||
"gvisor.dev/gvisor/pkg/tcpip/link/channel"
|
"gvisor.dev/gvisor/pkg/tcpip/link/channel"
|
||||||
"gvisor.dev/gvisor/pkg/tcpip/link/sniffer"
|
"gvisor.dev/gvisor/pkg/tcpip/link/sniffer"
|
||||||
|
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||||
"gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
|
"gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
|
||||||
|
|
||||||
"github.com/wencaiwulue/kubevpn/v2/pkg/config"
|
"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) {
|
func (h *gvisorLocalTCPHandler) Run(ctx context.Context) {
|
||||||
endpoint := channel.New(tcp.DefaultReceiveBufferSize, uint32(config.DefaultMTU), tcpip.GetRandMacAddr())
|
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() {
|
go func() {
|
||||||
defer util.HandleCrash()
|
defer util.HandleCrash()
|
||||||
readFromGvisorInboundWriteToEndpoint(ctx, h.gvisorInbound, endpoint)
|
readFromGvisorInboundWriteToEndpoint(ctx, h.gvisorInbound, endpoint)
|
||||||
|
@@ -10,6 +10,7 @@ import (
|
|||||||
"gvisor.dev/gvisor/pkg/tcpip"
|
"gvisor.dev/gvisor/pkg/tcpip"
|
||||||
"gvisor.dev/gvisor/pkg/tcpip/link/channel"
|
"gvisor.dev/gvisor/pkg/tcpip/link/channel"
|
||||||
"gvisor.dev/gvisor/pkg/tcpip/link/sniffer"
|
"gvisor.dev/gvisor/pkg/tcpip/link/sniffer"
|
||||||
|
"gvisor.dev/gvisor/pkg/tcpip/stack"
|
||||||
"gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
|
"gvisor.dev/gvisor/pkg/tcpip/transport/tcp"
|
||||||
|
|
||||||
"github.com/wencaiwulue/kubevpn/v2/pkg/config"
|
"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) {
|
func (h *gvisorTCPHandler) handle(ctx context.Context, tcpConn net.Conn) {
|
||||||
endpoint := channel.New(tcp.DefaultReceiveBufferSize, uint32(config.DefaultMTU), tcpip.GetRandMacAddr())
|
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)
|
errChan := make(chan error, 2)
|
||||||
go func() {
|
go func() {
|
||||||
defer util.HandleCrash()
|
defer util.HandleCrash()
|
||||||
|
Reference in New Issue
Block a user