]> git.puffer.fish Git - matthieu/frr.git/commitdiff
2003-10-27 Gilad Arnold <gilad.arnold@terayon.com>
authorpaul <paul>
Tue, 28 Oct 2003 03:47:15 +0000 (03:47 +0000)
committerpaul <paul>
Tue, 28 Oct 2003 03:47:15 +0000 (03:47 +0000)
        * zebra/zebra_rib.c: (nexthop_active_update) Check for multipath
          limit when setting changed flag to avoid spurious changes.
          (static_install_ipv{4,6}) dont uninstall by default, might not be
          required - avoid spurious uninstalls.
          (static_uninstall_ipv{4,6}) only uninstall the route if its
  actually FIB route.

zebra/zebra_rib.c

index ccccd0ad68c926da989c45ffdd3f20a815328131..05ff1e102365b5ebbd46510aeedd16ba8a52e95e 100644 (file)
@@ -759,12 +759,18 @@ nexthop_active_update (struct route_node *rn, struct rib *rib, int set)
   for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
     {
       active = CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE);
-      rib->nexthop_active_num += nexthop_active_check (rn, rib, nexthop, set);
-      if (active != CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
-       SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED);
+
+      nexthop_active_check (rn, rib, nexthop, set);
+      if ((MULTIPATH_NUM == 0 || rib->nexthop_active_num < MULTIPATH_NUM)
+          && active != CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
+        SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED);
+
+      if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
+        rib->nexthop_active_num++;
     }
   return rib->nexthop_active_num;
 }
+
 \f
 #define RIB_SYSTEM_ROUTE(R) \
         ((R)->type == ZEBRA_ROUTE_KERNEL || (R)->type == ZEBRA_ROUTE_CONNECT)
@@ -1298,7 +1304,6 @@ static_install_ipv4 (struct prefix *p, struct static_ipv4 *si)
     {
       /* Same distance static route is there.  Update it with new
          nexthop. */
-      rib_uninstall (rn, rib);
       route_unlock_node (rn);
       switch (si->type)
         {
@@ -1417,7 +1422,8 @@ static_uninstall_ipv4 (struct prefix *p, struct static_ipv4 *si)
     }
   else
     {
-      rib_uninstall (rn, rib);
+      if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
+        rib_uninstall (rn, rib);
       nexthop_delete (rib, nexthop);
       nexthop_free (nexthop);
       rib_process (rn, rib);
@@ -1860,7 +1866,6 @@ static_install_ipv6 (struct prefix *p, struct static_ipv6 *si)
     {
       /* Same distance static route is there.  Update it with new
          nexthop. */
-      rib_uninstall (rn, rib);
       route_unlock_node (rn);
 
       switch (si->type)
@@ -1980,7 +1985,8 @@ static_uninstall_ipv6 (struct prefix *p, struct static_ipv6 *si)
     }
   else
     {
-      rib_uninstall (rn, rib);
+      if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB))
+        rib_uninstall (rn, rib);
       nexthop_delete (rib, nexthop);
       nexthop_free (nexthop);
       rib_process (rn, rib);