mirror of
https://github.com/netbirdio/go-netroute.git
synced 2026-05-22 17:11:07 -07:00
fixup
This commit is contained in:
+6
-1
@@ -21,8 +21,13 @@ func (r *router) RouteWithSrc(input net.HardwareAddr, src, dst net.IP) (iface *n
|
||||
if dst.Equal(preferredSrc) {
|
||||
gateway = nil
|
||||
}
|
||||
return iface, gateway, preferredSrc, err
|
||||
}
|
||||
|
||||
func New() (routing.Router, error) {
|
||||
return router{routing.New()}
|
||||
r, err := routing.New()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return router{r}, nil
|
||||
}
|
||||
|
||||
+1
-1
@@ -222,7 +222,7 @@ func (r *winRouter) RouteWithSrc(input net.HardwareAddr, src, dst net.IP) (iface
|
||||
}
|
||||
iface = getIface(route.index)
|
||||
|
||||
if route nextHop == nil || route.nextHop.Addr.Family == 0 /* AF_UNDEF */ {
|
||||
if route.nextHop == nil || route.nextHop.Addr.Family == 0 /* AF_UNDEF */ {
|
||||
return iface, nil, pref, nil
|
||||
}
|
||||
addr, err := route.nextHop.Sockaddr()
|
||||
|
||||
Reference in New Issue
Block a user