diff --git a/cni/network/invoker_cns.go b/cni/network/invoker_cns.go index 02e0ce7351..78a0907a44 100644 --- a/cni/network/invoker_cns.go +++ b/cni/network/invoker_cns.go @@ -362,7 +362,7 @@ func getRoutes(cnsRoutes []cns.Route, skipDefaultRoutes bool) ([]network.RouteIn } gw := net.ParseIP(route.GatewayIPAddress) - if gw == nil && skipDefaultRoutes { + if skipDefaultRoutes { return nil, errors.Wrap(errInvalidGatewayIP, route.GatewayIPAddress) }