route: treat nhid changes as full route replacements #449
+7
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When updating a route targeting a nexthoup group with id changing its nexthop to a single nexthop, we treat this as an update and instead add that nexthop to the group instead of replacing the route in the cache.
So e.g. with
adding a route
libnl will store this as 2001:db8:1:/64 via fe80::1, fe80::2
if we now update the route with
libnl will see a new route with a single nexthop. Since the existing route for dst
2001:db8:1:/64is a multipath route, and the new route has a single nexthop, libnl assumes this is a new nexthop for the route, and merges it to2001:db8:1:/64 via fe80::1, fe80::2, fe80::3instead of replacing it.Fix this by checking the nhid of the routes, and only merge if they match.
Fixes: 29b7137 ("route cache: Fix handling of ipv6 multipath routes")