From 6f94d563831a5905bf7bc5ecbc21f40bc23fb9f8 Mon Sep 17 00:00:00 2001 From: yaling888 <73897884+yaling888@users.noreply.github.com> Date: Fri, 17 Sep 2021 16:49:53 +0800 Subject: [PATCH] Fix: gvisor ipv6 routeing in Tun --- listener/tun/ipstack/gvisor/tun.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/listener/tun/ipstack/gvisor/tun.go b/listener/tun/ipstack/gvisor/tun.go index a0ad15c1..d53f55b9 100644 --- a/listener/tun/ipstack/gvisor/tun.go +++ b/listener/tun/ipstack/gvisor/tun.go @@ -78,7 +78,7 @@ func NewAdapter(device dev.TunDevice, conf config.Tun, tunAddress string, tcpIn // So FindRoute will return correct route to tun NIC subnet, _ := tcpip.NewSubnet(tcpip.Address(strings.Repeat("\x00", 4)), tcpip.AddressMask(strings.Repeat("\x00", 4))) ipstack.AddRoute(tcpip.Route{Destination: subnet, Gateway: "", NIC: nicID}) - subnet, _ = tcpip.NewSubnet(tcpip.Address(strings.Repeat("\x00", 6)), tcpip.AddressMask(strings.Repeat("\x00", 6))) + subnet, _ = tcpip.NewSubnet(tcpip.Address(strings.Repeat("\x00", 16)), tcpip.AddressMask(strings.Repeat("\x00", 16))) ipstack.AddRoute(tcpip.Route{Destination: subnet, Gateway: "", NIC: nicID}) // TCP handler