-
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
staticd: fix changing to source auto in bfd monitor #14922
Conversation
staticd/static_routes.c
Outdated
case STATIC_IPV4_GATEWAY_IFNAME: | ||
case STATIC_IPV6_GATEWAY_IFNAME: | ||
static_zebra_nht_register(nh, false); |
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.
Isn't possible to do this operation only if the source IP is different from the previous one (last used)?
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.
You are correct. It is possible.
Done
When monitoring a static route with BFD multi-hop, the source IP can be either configured or retrieved from NextHop-Tracking (NHT). After removing a configured source, the source is supposed to be retrieved from NHT but it remains to the previous value. This is problematic if the user desires to fix the configuration of a incorrect source IP. For example, theses two commands results in the incorrect state: > ip route 10.0.0.0/24 10.1.0.1 bfd multi-hop source 10.2.2.2 > ip route 10.0.0.0/24 10.1.0.1 bfd multi-hop When removing the source, BFD is unable to find the source from NHT via bfd_nht_update() were called. Force zebra to resend the information to BFD by unregistering and registering again NHT. The (...)/frr-nexthops/nexthop northbound apply_finish function will trigger a call to static_install_nexthop() that does a call to static_zebra_nht_register(nh, true); Fixes: b7ca809 ("lib: BFD automatic source selection") Signed-off-by: Louis Scalbert <[email protected]>
Redispatch tests in bfd_topo3 in order to prepare next commit. Cosmetic change. Signed-off-by: Louis Scalbert <[email protected]>
Test setting a wrong bfd source and restore the source auto parameter. Signed-off-by: Louis Scalbert <[email protected]>
a74d734
to
94640da
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.
LGTM
https://github.com/Mergifyio backport stable/9.1 |
✅ Backports have been created
|
https://github.com/Mergifyio backport stable/9.0 |
✅ Backports have been created
|
staticd: fix changing to source auto in bfd monitor (backport #14922)
staticd: fix changing to source auto in bfd monitor (backport #14922)
When monitoring a static route with BFD multi-hop, the source IP can be
either configured or retrieved from NextHop-Tracking (NHT). After
removing a configured source, the source is supposed to be retrieved
from NHT but it remains to the previous value. This is problematic if
the user configured an incorrect source IP.
For example, theses two commands results in the incorrect state:
Unregister to nht before registering again on a route change. It forces
zebra to send again a ZEBRA_NEXTHOP_UPDATE zapi mesage to staticd in
order to trigger bfd_nht_update().
Fixes: b7ca809 ("lib: BFD automatic source selection")
Signed-off-by: Louis Scalbert [email protected]