File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,12 @@ func (o *Options) Inet4GatewayAddr() netip.Addr {
103103 case "darwin" :
104104 return o .Inet4Address [0 ].Addr ()
105105 default :
106- if HasNextAddress (o .Inet4Address [0 ], 1 ) {
107- return o .Inet4Address [0 ].Addr ().Next ()
108- } else {
109- return o .Inet4Address [0 ].Addr ()
106+ if ! o .InterfaceScope {
107+ if HasNextAddress (o .Inet4Address [0 ], 1 ) {
108+ return o .Inet4Address [0 ].Addr ().Next ()
109+ } else {
110+ return o .Inet4Address [0 ].Addr ()
111+ }
110112 }
111113 }
112114 }
@@ -127,10 +129,12 @@ func (o *Options) Inet6GatewayAddr() netip.Addr {
127129 case "darwin" :
128130 return o .Inet6Address [0 ].Addr ()
129131 default :
130- if HasNextAddress (o .Inet6Address [0 ], 1 ) {
131- return o .Inet6Address [0 ].Addr ().Next ()
132- } else {
133- return o .Inet6Address [0 ].Addr ()
132+ if ! o .InterfaceScope {
133+ if HasNextAddress (o .Inet6Address [0 ], 1 ) {
134+ return o .Inet6Address [0 ].Addr ().Next ()
135+ } else {
136+ return o .Inet6Address [0 ].Addr ()
137+ }
134138 }
135139 }
136140 }
You can’t perform that action at this time.
0 commit comments