Skip to content

Commit

Permalink
Fix gateway select
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed Nov 6, 2024
1 parent d95423e commit 32a92a4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tun.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ func (o *Options) Inet4GatewayAddr() netip.Addr {
return o.Inet4Gateway
}
if len(o.Inet4Address) > 0 {
if HasNextAddress(o.Inet4Address[0], 1) {
if runtime.GOOS == "android" {
} else if HasNextAddress(o.Inet4Address[0], 1) {
return o.Inet4Address[0].Addr().Next()
} else if runtime.GOOS != "linux" {
return o.Inet4Address[0].Addr()
Expand All @@ -103,7 +104,8 @@ func (o *Options) Inet6GatewayAddr() netip.Addr {
return o.Inet6Gateway
}
if len(o.Inet6Address) > 0 {
if HasNextAddress(o.Inet6Address[0], 1) {
if runtime.GOOS == "android" {
} else if HasNextAddress(o.Inet6Address[0], 1) {
return o.Inet6Address[0].Addr().Next()
} else if runtime.GOOS != "linux" {
return o.Inet6Address[0].Addr()
Expand Down

0 comments on commit 32a92a4

Please sign in to comment.