Merge pull request #1936 from amshinde/ignore-routes-with-kernel-proto

network: Ignore routes with proto as "kernel"
This commit is contained in:
Eric Ernst 2019-08-12 07:08:34 -07:00 committed by GitHub
commit cfedb06a19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -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()

View File

@ -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()