From 5ae25fc19a9aeba5e53a8abe163401f5b1ecdaac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 6 Nov 2024 19:39:18 +0800 Subject: [PATCH] Fix gateway select --- tun.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tun.go b/tun.go index f1688fa..f37dd6f 100644 --- a/tun.go +++ b/tun.go @@ -91,7 +91,7 @@ func (o *Options) Inet4GatewayAddr() netip.Addr { if len(o.Inet4Address) > 0 { if HasNextAddress(o.Inet4Address[0], 1) { return o.Inet4Address[0].Addr().Next() - } else if runtime.GOOS != "linux" { + } else if runtime.GOOS != "linux" && runtime.GOOS != "android" { return o.Inet4Address[0].Addr() } } @@ -105,7 +105,7 @@ func (o *Options) Inet6GatewayAddr() netip.Addr { if len(o.Inet6Address) > 0 { if HasNextAddress(o.Inet6Address[0], 1) { return o.Inet6Address[0].Addr().Next() - } else if runtime.GOOS != "linux" { + } else if runtime.GOOS != "linux" && runtime.GOOS != "android" { return o.Inet6Address[0].Addr() } }