From acf9ba1280d776d2390d8ed2ea29099c830d6f71 Mon Sep 17 00:00:00 2001 From: gVisor bot Date: Wed, 5 Jan 2022 01:50:43 +0800 Subject: [PATCH] make tun config compatible with premium --- config/config.go | 2 +- listener/tun/dev/dev_linux.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/config.go b/config/config.go index f077dcf3..27cd7355 100644 --- a/config/config.go +++ b/config/config.go @@ -209,7 +209,7 @@ func UnmarshalRawConfig(buf []byte) (*RawConfig, error) { Tun: Tun{ Enable: false, Stack: "gvisor", - DnsHijack: []string{"192.18.0.2:53"}, + DnsHijack: []string{"0.0.0.0:53"}, AutoRoute: true, AutoDetectInterface: true, }, diff --git a/listener/tun/dev/dev_linux.go b/listener/tun/dev/dev_linux.go index 4d63a87d..d04227ef 100644 --- a/listener/tun/dev/dev_linux.go +++ b/listener/tun/dev/dev_linux.go @@ -38,8 +38,8 @@ type tunLinux struct { // OpenTunDevice return a TunDevice according a URL func OpenTunDevice(tunAddress string, autoRoute bool) (TunDevice, error) { - deviceURL, _ := url.Parse("dev://meta") - mtu, _ := strconv.ParseInt(deviceURL.Query().Get("mtu"), 0, 32) + deviceURL, _ := url.Parse("dev://meta?mtu=9000") + mtu, _ := strconv.ParseUint(deviceURL.Query().Get("mtu"), 10, 32) t := &tunLinux{ url: deviceURL.String(),