-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
zebra: fix wrong nexthop status for kernel routes #17544
Conversation
To me, it looks like separate commits should be used for these somewhat relative issues. Also, can you create a topotest covering this case? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks okay ... separate commits, clear the rest of @ton31337 's comments ...
b2834cd
to
9b5738f
Compare
The kernel routes are wrongly selected even the nexthop interface is linkdown. Use `ip link set dev <interface> down` on the other box to set the box's nexthop interface linkdown. The kernel routes will be kept as `linkdown`, but are still with active nexthop in `zebra`. Add three changes/commits for kernel routes in this PR: 1) The active nexthop should be the operative interface. 2) Don't uninstall the kernel routes from `zebra` even no active nexthops. (It doesn't affect the kernel routes' deletion from kernel netlink messages.) 3) Update the kernel routes when the nexthop interface becomes up. Before: (during nexthop interface is linkdown) ``` K>* 3.3.3.3/32 [0/0] via 88.88.88.1, enp2s0, weight 1, 00:00:14 ``` After: (during nexthop interface is linkdown, with all three changes) ``` K 3.3.3.3/32 [0/0] via 88.88.88.1, enp2s0 inactive, weight 1, 00:00:07 ``` This commit is 1st change: Improve the judgment for "active" nexthop to be more accurate, the active nexthop should be the operative interface. Signed-off-by: anlan_cs <[email protected]>
After the nexthop check is fixed, zebra will wrongly uninstall the kernel routes with inactive nexthop. This commit would skip the uninstallation for kernel routes. Signed-off-by: anlan_cs <[email protected]>
Just like `link down`, check all kernel routes when interface become up. And, they maybe will be selected as the best one by zebra. Signed-off-by: anlan_cs <[email protected]>
Signed-off-by: anlan_cs <[email protected]>
9b5738f
to
2f1bd3f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
@riw777 Are there any plans to backport this fix to stable/10.2 branch? |
@riw777 as stable/9.1 is affected, too - can this be backported there as well? |
The kernel routes are wronlgy active even the nexthop interface is linkdown.
Use
ip link set dev <interface> down
on the other box to set the box'snexthop interface linkdown. The kernel routes will be kept as
linkdown
,but are still with active nexthop in
zebra
.Add three changes for kernel routes in this commit:
zebra
even no active nexthops.(It doesn't affect the kernel routes' deletion from kernel netlink messages.)
Before: (during nexthop interface is linkdown)
After: (during nexthop interface is linkdown)