mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-29 12:54:10 +00:00
Merge pull request #57 from amshinde/skip-ipv6-gateway
Skip routes with ipv6 gateway
This commit is contained in:
commit
d1bdf80f56
@ -143,6 +143,12 @@ func (h *hyper) processHyperRoute(route netlink.Route, deviceName string) *hyper
|
|||||||
gateway := route.Gw.String()
|
gateway := route.Gw.String()
|
||||||
if gateway == "<nil>" {
|
if gateway == "<nil>" {
|
||||||
gateway = ""
|
gateway = ""
|
||||||
|
} else if route.Gw.To4() == nil { // Skip IPv6 as it is not supported by hyperstart agent
|
||||||
|
h.Logger().WithFields(logrus.Fields{
|
||||||
|
"unsupported-route-type": "ipv6",
|
||||||
|
"gateway": gateway,
|
||||||
|
}).Warn("unsupported route")
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var destination string
|
var destination string
|
||||||
|
@ -27,11 +27,11 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
|
kataclient "github.com/kata-containers/agent/protocols/client"
|
||||||
|
"github.com/kata-containers/agent/protocols/grpc"
|
||||||
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
vcAnnotations "github.com/kata-containers/runtime/virtcontainers/pkg/annotations"
|
||||||
ns "github.com/kata-containers/runtime/virtcontainers/pkg/nsenter"
|
ns "github.com/kata-containers/runtime/virtcontainers/pkg/nsenter"
|
||||||
"github.com/kata-containers/runtime/virtcontainers/pkg/uuid"
|
"github.com/kata-containers/runtime/virtcontainers/pkg/uuid"
|
||||||
kataclient "github.com/kata-containers/agent/protocols/client"
|
|
||||||
"github.com/kata-containers/agent/protocols/grpc"
|
|
||||||
"github.com/opencontainers/runtime-spec/specs-go"
|
"github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
@ -378,7 +378,17 @@ func (k *kataAgent) generateInterfacesAndRoutes(networkNS NetworkNamespace) ([]*
|
|||||||
}
|
}
|
||||||
|
|
||||||
if route.Gw != nil {
|
if route.Gw != nil {
|
||||||
r.Gateway = route.Gw.String()
|
gateway := route.Gw.String()
|
||||||
|
|
||||||
|
if route.Gw.To4() == nil {
|
||||||
|
// Skip IPv6 because is is not supported
|
||||||
|
k.Logger().WithFields(logrus.Fields{
|
||||||
|
"unsupported-route-type": "ipv6",
|
||||||
|
"gateway": gateway,
|
||||||
|
}).Warn("unsupported route")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
r.Gateway = gateway
|
||||||
}
|
}
|
||||||
|
|
||||||
if route.Src != nil {
|
if route.Src != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user