From: Donald Sharp Date: Thu, 11 Jun 2015 16:11:12 +0000 (-0700) Subject: The CHANGED flag may be set for a route (RIB entry) due to change in X-Git-Tag: frr-2.0-rc1~1348 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8733ba725d83a688673f3cdae79efcad5991e773;p=matthieu%2Ffrr.git The CHANGED flag may be set for a route (RIB entry) due to change in interface or nexthop status. However, this route may not be selected as the best and may not be the prior best. The flag needs to be reset after evaluating the route as not doing so may prevent future nexthop validation for this route. --- diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 7c07d9d245..db679e8575 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -1568,7 +1568,10 @@ rib_process (struct route_node *rn) /* Infinit distance. */ if (rib->distance == DISTANCE_INFINITY) - continue; + { + UNSET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); + continue; + } /* Newly selected rib, the common case. */ if (!select) @@ -1591,26 +1594,41 @@ rib_process (struct route_node *rn) { if (select->type != ZEBRA_ROUTE_CONNECT || rib->metric <= select->metric) - select = rib; + { + UNSET_FLAG (select->flags, ZEBRA_FLAG_CHANGED); + select = rib; + } + else + UNSET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); continue; } else if (select->type == ZEBRA_ROUTE_CONNECT) - continue; + { + UNSET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); + continue; + } /* higher distance loses */ if (rib->distance > select->distance) - continue; + { + UNSET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); + continue; + } /* lower wins */ if (rib->distance < select->distance) { + UNSET_FLAG (select->flags, ZEBRA_FLAG_CHANGED); select = rib; continue; } /* metric tie-breaks equal distance */ if (rib->metric <= select->metric) - select = rib; + { + UNSET_FLAG (select->flags, ZEBRA_FLAG_CHANGED); + select = rib; + } } /* RNODE_FOREACH_RIB_SAFE */ /* After the cycle is finished, the following pointers will be set: