This commit is contained in:
Will Scott
2020-03-08 12:58:20 -07:00
parent fb84409e2a
commit 1e73e463a8
2 changed files with 7 additions and 2 deletions
+6 -1
View File
@@ -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
View File
@@ -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()