/* Add RIB to head of the route node. */
static void
-rib_link (struct route_node *rn, struct rib *rib)
+rib_link (struct route_node *rn, struct rib *rib, int process)
{
struct rib *head;
rib_dest_t *dest;
/* Further processing only if entry is in main table */
if ((rib->table == RT_TABLE_MAIN) || (rib->table == zebrad.rtm_table_default))
- rib_queue_add (&zebrad, rn);
+ {
+ if (process)
+ rib_queue_add (&zebrad, rn);
+ }
else
{
afi = (rn->p.family == AF_INET) ? AFI_IP :
}
static void
-rib_addnode (struct route_node *rn, struct rib *rib)
+rib_addnode (struct route_node *rn, struct rib *rib, int process)
{
/* RIB node has been un-removed before route-node is processed.
* route_node must hence already be on the queue for processing..
UNSET_FLAG (rib->status, RIB_ENTRY_REMOVED);
return;
}
- rib_link (rn, rib);
+ rib_link (rn, rib, process);
}
/*
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
rib_dump ((struct prefix *)p, rib);
}
- rib_addnode (rn, rib);
+ rib_addnode (rn, rib, 1);
/* Free implicit route.*/
if (same)
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
rib_dump ((struct prefix *)p, rib);
}
- rib_addnode (rn, rib);
+ rib_addnode (rn, rib, 1);
ret = 1;
/* Free implicit route.*/
si->vrf_id, buf, p->prefixlen, rn, rib, rib->type);
}
}
- rib_queue_add (&zebrad, rn);
+ /* Schedule route for processing or invoke NHT, as appropriate. */
+ if (si->type == STATIC_IPV4_GATEWAY ||
+ si->type == STATIC_IPV6_GATEWAY)
+ zebra_evaluate_rnh(si->vrf_id, nh_p.family, 1, RNH_NEXTHOP_TYPE, &nh_p);
+ else
+ rib_queue_add (&zebrad, rn);
}
else
{
/* Save the flags of this static routes (reject, blackhole) */
rib->flags = si->flags;
- /* Link this rib to the tree. */
if (IS_ZEBRA_DEBUG_RIB)
{
char buf[INET6_ADDRSTRLEN];
si->vrf_id, buf, p->prefixlen, rn, rib, rib->type);
}
}
- rib_addnode (rn, rib);
+ /* Link this rib to the tree. Schedule for processing or invoke NHT,
+ * as appropriate.
+ */
+ if (si->type == STATIC_IPV4_GATEWAY ||
+ si->type == STATIC_IPV6_GATEWAY)
+ {
+ rib_addnode (rn, rib, 0);
+ zebra_evaluate_rnh(si->vrf_id, nh_p.family, 1, RNH_NEXTHOP_TYPE, &nh_p);
+ }
+ else
+ rib_addnode (rn, rib, 1);
}
}
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
rib_dump ((struct prefix *)p, rib);
}
- rib_addnode (rn, rib);
+ rib_addnode (rn, rib, 1);
/* Free implicit route.*/
if (same)
if (IS_ZEBRA_DEBUG_RIB_DETAILED)
rib_dump ((struct prefix *)p, rib);
}
- rib_addnode (rn, rib);
+ rib_addnode (rn, rib, 1);
ret = 1;
/* Free implicit route.*/