summaryrefslogtreecommitdiff
path: root/zebra
diff options
context:
space:
mode:
authorpaul <paul>2003-10-28 03:47:15 +0000
committerpaul <paul>2003-10-28 03:47:15 +0000
commit6baeb98892ee1c574af5cd3896a3a6d65cef0117 (patch)
treeea244accc69fe5778a747c3a2c2e5c1387df7b63 /zebra
parent948cf55c4447257960fda0d89fb45e93644393b1 (diff)
2003-10-27 Gilad Arnold <gilad.arnold@terayon.com>
* 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.
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_rib.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index ccccd0ad..05ff1e10 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -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;
}
+
#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);