diff --git a/tun.go b/tun.go index f1688fa..1a86f6c 100644 --- a/tun.go +++ b/tun.go @@ -89,12 +89,12 @@ func (o *Options) Inet4GatewayAddr() netip.Addr { return o.Inet4Gateway } if len(o.Inet4Address) > 0 { - if HasNextAddress(o.Inet4Address[0], 1) { - return o.Inet4Address[0].Addr().Next() - } else if runtime.GOOS != "linux" { - return o.Inet4Address[0].Addr() + if HasNextAddress(o.Inet4Address[0], 1) { + return o.Inet4Address[0].Addr().Next() + } else if runtime.GOOS != "linux" && runtime.GOOS != "android" { + return o.Inet4Address[0].Addr() + } } - } return netip.IPv4Unspecified() } @@ -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() } }