diff --git a/netmon/netmon.go b/netmon/netmon.go index 9d0c5d9d82..b4b74ad120 100644 --- a/netmon/netmon.go +++ b/netmon/netmon.go @@ -307,6 +307,11 @@ func convertRoutes(netRoutes []netlink.Route) []vcTypes.Route { // by Kata yet. for _, netRoute := range netRoutes { dst := "" + + if netRoute.Protocol == unix.RTPROT_KERNEL { + continue + } + if netRoute.Dst != nil { if netRoute.Dst.IP.To4() != nil { dst = netRoute.Dst.String() diff --git a/virtcontainers/network.go b/virtcontainers/network.go index df553f4c27..c1e1fa9c66 100644 --- a/virtcontainers/network.go +++ b/virtcontainers/network.go @@ -1170,6 +1170,10 @@ func generateInterfacesAndRoutes(networkNS NetworkNamespace) ([]*vcTypes.Interfa for _, route := range endpoint.Properties().Routes { var r vcTypes.Route + if route.Protocol == unix.RTPROT_KERNEL { + continue + } + if route.Dst != nil { r.Dest = route.Dst.String()