bgpd: For deterministic MED build a multipath set for each peer AS as the
first stage of the best path calculation. The second stage then
selects a winner from each peer AS's best path. In the second stage we
clear multipath set of the non-selected best paths via
bgp_mp_dmed_deselect(). Since the multipath set is already marked up
for the winning path, we don't call bgp_info_mpath_update() after the
second stage calculation.
* bgpd/bgp_mpath.c
* bgp_mp_dmed_deselect(): New function to cleanup the multipath
markup if a DMED selected path loses in stage 2 of the best path
calculation
* bgpd/bgp_mpath.h
* Add external declaration of bgp_mp_dmed_deselect()
* bgpd/bgp_route.c
* bgp_best_selection(): If multipath is enabled, build up the mp_list
for the current peer AS, and do the RIB markup the best path from
that AS. In the second stage, clear the RIB markup for the DMED
selected path if it is not selected as best. Only call
bgp_info_mpath_update() in the second stage when not doing
deterministic MED.
diff --git a/bgpd/bgp_mpath.h b/bgpd/bgp_mpath.h
index 1dc2687..3712493 100644
--- a/bgpd/bgp_mpath.h
+++ b/bgpd/bgp_mpath.h
@@ -55,6 +55,7 @@
extern void bgp_mp_list_init (struct list *);
extern void bgp_mp_list_clear (struct list *);
extern void bgp_mp_list_add (struct list *, struct bgp_info *);
+extern void bgp_mp_dmed_deselect (struct bgp_info *);
extern void bgp_info_mpath_update (struct bgp_node *, struct bgp_info *,
struct bgp_info *, struct list *,
struct bgp_maxpaths_cfg *);