File tree 1 file changed +6
-2
lines changed
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -89,7 +89,9 @@ func (o *Options) Inet4GatewayAddr() netip.Addr {
89
89
return o .Inet4Gateway
90
90
}
91
91
if len (o .Inet4Address ) > 0 {
92
- if HasNextAddress (o .Inet4Address [0 ], 1 ) {
92
+ if runtime .GOOS == "android" {
93
+ // avoid "add route 0: network is unreachable"
94
+ } else if HasNextAddress (o .Inet4Address [0 ], 1 ) {
93
95
return o .Inet4Address [0 ].Addr ().Next ()
94
96
} else if runtime .GOOS != "linux" {
95
97
return o .Inet4Address [0 ].Addr ()
@@ -103,7 +105,9 @@ func (o *Options) Inet6GatewayAddr() netip.Addr {
103
105
return o .Inet6Gateway
104
106
}
105
107
if len (o .Inet6Address ) > 0 {
106
- if HasNextAddress (o .Inet6Address [0 ], 1 ) {
108
+ if runtime .GOOS == "android" {
109
+ // avoid "add route 0: network is unreachable"
110
+ } else if HasNextAddress (o .Inet6Address [0 ], 1 ) {
107
111
return o .Inet6Address [0 ].Addr ().Next ()
108
112
} else if runtime .GOOS != "linux" {
109
113
return o .Inet6Address [0 ].Addr ()
You can’t perform that action at this time.
0 commit comments