diff options
| author | Louis Scalbert <louis.scalbert@6wind.com> | 2023-11-30 17:29:20 +0100 | 
|---|---|---|
| committer | Louis Scalbert <louis.scalbert@6wind.com> | 2023-12-01 14:08:57 +0100 | 
| commit | 580c605194b3893a1d61a997a7b9d62e2d877427 (patch) | |
| tree | b3c655c02027575cefe81d20e36df494537158fb /staticd/static_nb_config.c | |
| parent | e6e846de238255f9995b71c24d287b0f26c50c24 (diff) | |
staticd: fix changing to source auto in bfd monitor
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: b7ca809d1c ("lib: BFD automatic source selection")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Diffstat (limited to 'staticd/static_nb_config.c')
| -rw-r--r-- | staticd/static_nb_config.c | 12 | 
1 files changed, 12 insertions, 0 deletions
diff --git a/staticd/static_nb_config.c b/staticd/static_nb_config.c index ede2e38754..8a497304a8 100644 --- a/staticd/static_nb_config.c +++ b/staticd/static_nb_config.c @@ -18,6 +18,7 @@  #include "static_vrf.h"  #include "static_routes.h"  #include "static_nb.h" +#include "static_zebra.h"  static int static_path_list_create(struct nb_cb_create_args *args) @@ -960,6 +961,17 @@ int route_next_hop_bfd_source_destroy(struct nb_cb_destroy_args *args)  	sn = nb_running_get_entry(args->dnode, NULL, true);  	static_next_hop_bfd_auto_source(sn); + +	/* NHT information are needed by BFD to automatically find the source +	 * +	 * 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); +	 * static_zebra_nht_register(sn, false); +	 */ +	static_zebra_nht_register(sn, false); +  	return NB_OK;  }  | 
