mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-10 12:22:36 +00:00
Merge pull request #1936 from amshinde/ignore-routes-with-kernel-proto
network: Ignore routes with proto as "kernel"
This commit is contained in:
commit
cfedb06a19
@ -307,6 +307,11 @@ func convertRoutes(netRoutes []netlink.Route) []vcTypes.Route {
|
|||||||
// by Kata yet.
|
// by Kata yet.
|
||||||
for _, netRoute := range netRoutes {
|
for _, netRoute := range netRoutes {
|
||||||
dst := ""
|
dst := ""
|
||||||
|
|
||||||
|
if netRoute.Protocol == unix.RTPROT_KERNEL {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if netRoute.Dst != nil {
|
if netRoute.Dst != nil {
|
||||||
if netRoute.Dst.IP.To4() != nil {
|
if netRoute.Dst.IP.To4() != nil {
|
||||||
dst = netRoute.Dst.String()
|
dst = netRoute.Dst.String()
|
||||||
|
@ -1170,6 +1170,10 @@ func generateInterfacesAndRoutes(networkNS NetworkNamespace) ([]*vcTypes.Interfa
|
|||||||
for _, route := range endpoint.Properties().Routes {
|
for _, route := range endpoint.Properties().Routes {
|
||||||
var r vcTypes.Route
|
var r vcTypes.Route
|
||||||
|
|
||||||
|
if route.Protocol == unix.RTPROT_KERNEL {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if route.Dst != nil {
|
if route.Dst != nil {
|
||||||
r.Dest = route.Dst.String()
|
r.Dest = route.Dst.String()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user