Merge pull request #887 from champtar/route-CHECK

Fix ValidateExpectedRoute with non default routes and nil GW
This commit is contained in:
Dan Williams
2023-04-24 10:41:24 -05:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@ -83,7 +83,10 @@ func ValidateExpectedRoute(resultRoutes []*types.Route) error {
// Ensure that each static route in prevResults is found in the routing table
for _, route := range resultRoutes {
find := &netlink.Route{Dst: &route.Dst, Gw: route.GW}
routeFilter := netlink.RT_FILTER_DST | netlink.RT_FILTER_GW
routeFilter := netlink.RT_FILTER_DST
if route.GW != nil {
routeFilter |= netlink.RT_FILTER_GW
}
var family int
switch {