Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

devices: allow local route entries in device mngr #24608

Merged
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 1 addition & 4 deletions pkg/datapath/linux/devices.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,10 @@ func (dm *DeviceManager) updateDevicesFromRoutes(l3DevOK bool, routes []netlink.
// Collect all link indices mentioned in the route update batch
for _, route := range routes {
// Only consider devices that have global unicast routes,
// e.g. skip loopback, multicast and link local routes.
// e.g. skip loopback, multicast.
if route.Dst != nil && !route.Dst.IP.IsGlobalUnicast() {
continue
}
if route.Table == unix.RT_TABLE_LOCAL {
continue
}
linkInfo := linkInfos[route.LinkIndex]
linkInfo.hasDefaultRoute = linkInfo.hasDefaultRoute || route.Dst == nil
linkInfos[route.LinkIndex] = linkInfo
Expand Down
3 changes: 0 additions & 3 deletions pkg/datapath/linux/devices_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,9 +561,6 @@ func delRoutes(iface string) error {
}

for _, r := range routes {
if r.Table == unix.RT_TABLE_LOCAL {
continue
}
if err := netlink.RouteDel(&r); err != nil {
return err
}
Expand Down