Skip to content
This repository has been archived by the owner on Apr 3, 2018. It is now read-only.

Ignore route with ipv6 gateway #673

Merged
merged 2 commits into from
Mar 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions hyperstart_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ func (h *hyper) processHyperRoute(route netlink.Route, deviceName string) *hyper
gateway := route.Gw.String()
if gateway == "<nil>" {
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
Expand Down
12 changes: 11 additions & 1 deletion kata_agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,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 {
Expand Down