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

staticd: fix changing to source auto in bfd monitor #14922

Merged
merged 3 commits into from
Dec 6, 2023

Conversation

louis-6wind
Copy link
Contributor

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:

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

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]

case STATIC_IPV4_GATEWAY_IFNAME:
case STATIC_IPV6_GATEWAY_IFNAME:
static_zebra_nht_register(nh, false);
Copy link
Member

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)?

Copy link
Contributor Author

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]>
@louis-6wind louis-6wind force-pushed the fix-bfd-static-source branch from a74d734 to 94640da Compare December 1, 2023 13:09
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rzalamena rzalamena merged commit cad5ee5 into FRRouting:master Dec 6, 2023
77 checks passed
@pguibert6WIND
Copy link
Member

https://github.com/Mergifyio backport stable/9.1

Copy link

mergify bot commented Dec 6, 2023

backport stable/9.1

✅ Backports have been created

@pguibert6WIND
Copy link
Member

https://github.com/Mergifyio backport stable/9.0

Copy link

mergify bot commented Dec 6, 2023

backport stable/9.0

✅ Backports have been created

ton31337 added a commit that referenced this pull request Dec 6, 2023
staticd: fix changing to source auto in bfd monitor  (backport #14922)
donaldsharp added a commit that referenced this pull request Dec 7, 2023
staticd: fix changing to source auto in bfd monitor  (backport #14922)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants