From fa99b3f9813dcf44b6630a46aa74af2bfb4634af Mon Sep 17 00:00:00 2001 From: Kr328 <39107975+Kr328@users.noreply.github.com> Date: Sat, 30 Nov 2019 02:32:23 +0800 Subject: [PATCH] add ipv6 dnsredirect --- core/src/main/golang/tun/dnsredirect.go | 6 ++++-- core/src/main/golang/tun/tun.go | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/main/golang/tun/dnsredirect.go b/core/src/main/golang/tun/dnsredirect.go index 3680f02..86f73c1 100644 --- a/core/src/main/golang/tun/dnsredirect.go +++ b/core/src/main/golang/tun/dnsredirect.go @@ -12,8 +12,10 @@ import ( "github.com/google/netstack/waiter" ) -const defaultTimeout = 5 -const defaultDNS = "8.8.8.8" +const ( + defaultTimeout = 5 + defaultDNS = "8.8.8.8" +) type DnsRedirectEndpoint struct { stack *stack.Stack diff --git a/core/src/main/golang/tun/tun.go b/core/src/main/golang/tun/tun.go index 6818abc..e912505 100644 --- a/core/src/main/golang/tun/tun.go +++ b/core/src/main/golang/tun/tun.go @@ -9,6 +9,7 @@ import ( "github.com/google/netstack/tcpip" "github.com/google/netstack/tcpip/network/ipv4" + "github.com/google/netstack/tcpip/network/ipv6" "github.com/google/netstack/tcpip/stack" "github.com/google/netstack/tcpip/transport/udp" ) @@ -46,6 +47,7 @@ func StartTunProxy(fd, mtu int) error { if err := s.RegisterTransportEndpoint(1, []tcpip.NetworkProtocolNumber{ ipv4.ProtocolNumber, + ipv6.ProtocolNumber, }, udp.ProtocolNumber, *id,