summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_mpath.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bgpd/bgp_mpath.c b/bgpd/bgp_mpath.c
index 44823c4b..1709c244 100644
--- a/bgpd/bgp_mpath.c
+++ b/bgpd/bgp_mpath.c
@@ -521,12 +521,13 @@ bgp_info_mpath_update (struct bgp_node *rn, struct bgp_info *new_best,
*/
new_mpath = listgetdata (mp_node);
list_delete_node (mp_list, mp_node);
- if (new_mpath == next_mpath)
- next_mpath = bgp_info_mpath_next (new_mpath);
- bgp_info_mpath_dequeue (new_mpath);
if ((mpath_count < maxpaths) && (new_mpath != new_best) &&
bgp_info_nexthop_cmp (prev_mpath, new_mpath))
{
+ if (new_mpath == next_mpath)
+ next_mpath = bgp_info_mpath_next (new_mpath);
+ bgp_info_mpath_dequeue (new_mpath);
+
bgp_info_mpath_enqueue (prev_mpath, new_mpath);
prev_mpath = new_mpath;
mpath_changed = 1;