-
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: Kernel routes are not updated properly in zebra RIB / nhg nexthop check is wrong #13561 #17045
base: master
Are you sure you want to change the base?
zebra: Kernel routes are not updated properly in zebra RIB / nhg nexthop check is wrong #13561 #17045
Conversation
Signed-off-by: DennyAgussy <gkruparaju@msystechnologies.com>
put the discussion in the actual commit message then we can look at this. I'm pretty dubious about making this chagne as that I believe it would break some onlink routes |
@@ -2648,7 +2648,7 @@ static unsigned nexthop_active_check(struct route_node *rn, | |||
|
|||
ifp = if_lookup_by_index(nexthop->ifindex, nexthop->vrf_id); | |||
|
|||
if (ifp && ifp->vrf->vrf_id == vrf_id && if_is_up(ifp)) { | |||
if (ifp && ifp->vrf->vrf_id == vrf_id && if_is_up(ifp) && if_connected_count(ifp->connected)) { | |||
SET_FLAG(nexthop->flags, NEXTHOP_FLAG_ACTIVE); |
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.
I wonder if it is enough. what happens if, for a given ipv4 route, you remove all ipv4 addresses, knowing that you have 1 ipv6 address left? or the opposite for a given ipv6 route.
should not we involve the 'v6-with-v4-nexthop' flag into this control too ?
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.
Why? The kernel is telling us that it has a valid route. What does it matter that there are any addresses on the interface? I can have a route without any addresses on an interface especially with a onlink attribute
### I have tested whether ONLINK routes will get break with the fix and master branch with two scenarios mentioned below and also let's know if we have include any additional cases :
Tested on Master-branch(56495a8): Config:
Is this a bug scenario? Logs after flush:
scenario 2 will of course works as expected. On the branch we did fix:We have tested the same two scenarios, the behavior is same as the Master branch(Not breaking any route in scenario 2). Also behaves the same in scenario 1. |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Kernel routes are not updated properly in zebra RIB / nhg nexthop check is wrong: #13561
Introduction:
Zebra is not restoring the routes properly as mentioned in the bug-13561. When we do flush on an interface having the default route, zebra is still advertising the default route which it shouldn't. As we flush the interface the default route should unadvertised in vtysh -c "show ip route".
Implementation details:
To overcome this issue we have added a check. Which helps in checking whether the interface has at least one connected route. If the interface has a connected route then it will skip the intermediate checks and go directly to "skip_check: ". With this check in place everything is working - where default route is being unadvertised in vtysh -c "show ip route".
Necessary unit testing and topotests have been done.
Thanks
Denny Agussy
Nandini D