diff --git a/virtcontainers/hyperstart_agent.go b/virtcontainers/hyperstart_agent.go index 932d722c59..251e705ea9 100644 --- a/virtcontainers/hyperstart_agent.go +++ b/virtcontainers/hyperstart_agent.go @@ -143,6 +143,12 @@ func (h *hyper) processHyperRoute(route netlink.Route, deviceName string) *hyper gateway := route.Gw.String() if 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 diff --git a/virtcontainers/kata_agent.go b/virtcontainers/kata_agent.go index 6a8f593d67..5df14e9d46 100644 --- a/virtcontainers/kata_agent.go +++ b/virtcontainers/kata_agent.go @@ -27,11 +27,11 @@ import ( "strings" "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" ns "github.com/kata-containers/runtime/virtcontainers/pkg/nsenter" "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/sirupsen/logrus" ) @@ -378,7 +378,17 @@ func (k *kataAgent) generateInterfacesAndRoutes(networkNS NetworkNamespace) ([]* } 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 {