]> git.puffer.fish Git - mirror/frr.git/commitdiff
The CHANGED flag may be set for a route (RIB entry) due to change in
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 11 Jun 2015 16:11:12 +0000 (09:11 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 11 Jun 2015 16:11:12 +0000 (09:11 -0700)
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.

zebra/zebra_rib.c

index 7c07d9d24549ea6703815f282caa9a80ee724221..db679e85755ab8ff5549bac02a85ff8a5c06e62b 100644 (file)
@@ -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: