mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 17:18:56 +00:00
[zebra] ignore dead routes in RIB update
2008-08-17 Stephen Hemminger <stephen.hemminger@vyatta.com> * zebra_rib.c: When doing a RIB update, routes in process of removal should be ignored. This fixes bugs where a route is removed but a recursive route is not changed. Signed-off-by: Paul Jakma <paul@quagga.net>
This commit is contained in:
parent
4c699477d2
commit
16814f9698
@ -376,8 +376,12 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set,
|
|||||||
|
|
||||||
/* Pick up selected route. */
|
/* Pick up selected route. */
|
||||||
for (match = rn->info; match; match = match->next)
|
for (match = rn->info; match; match = match->next)
|
||||||
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
{
|
||||||
break;
|
if (CHECK_FLAG (match->status, RIB_ENTRY_REMOVED))
|
||||||
|
continue;
|
||||||
|
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* If there is no selected route or matched route is EGP, go up
|
/* If there is no selected route or matched route is EGP, go up
|
||||||
tree. */
|
tree. */
|
||||||
@ -473,8 +477,12 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set,
|
|||||||
|
|
||||||
/* Pick up selected route. */
|
/* Pick up selected route. */
|
||||||
for (match = rn->info; match; match = match->next)
|
for (match = rn->info; match; match = match->next)
|
||||||
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
{
|
||||||
break;
|
if (CHECK_FLAG (match->status, RIB_ENTRY_REMOVED))
|
||||||
|
continue;
|
||||||
|
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* If there is no selected route or matched route is EGP, go up
|
/* If there is no selected route or matched route is EGP, go up
|
||||||
tree. */
|
tree. */
|
||||||
@ -560,8 +568,12 @@ rib_match_ipv4 (struct in_addr addr)
|
|||||||
|
|
||||||
/* Pick up selected route. */
|
/* Pick up selected route. */
|
||||||
for (match = rn->info; match; match = match->next)
|
for (match = rn->info; match; match = match->next)
|
||||||
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
{
|
||||||
break;
|
if (CHECK_FLAG (match->status, RIB_ENTRY_REMOVED))
|
||||||
|
continue;
|
||||||
|
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* If there is no selected route or matched route is EGP, go up
|
/* If there is no selected route or matched route is EGP, go up
|
||||||
tree. */
|
tree. */
|
||||||
@ -613,10 +625,13 @@ rib_lookup_ipv4 (struct prefix_ipv4 *p)
|
|||||||
/* Unlock node. */
|
/* Unlock node. */
|
||||||
route_unlock_node (rn);
|
route_unlock_node (rn);
|
||||||
|
|
||||||
/* Pick up selected route. */
|
|
||||||
for (match = rn->info; match; match = match->next)
|
for (match = rn->info; match; match = match->next)
|
||||||
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
{
|
||||||
break;
|
if (CHECK_FLAG (match->status, RIB_ENTRY_REMOVED))
|
||||||
|
continue;
|
||||||
|
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (! match || match->type == ZEBRA_ROUTE_BGP)
|
if (! match || match->type == ZEBRA_ROUTE_BGP)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -668,12 +683,12 @@ rib_lookup_ipv4_route (struct prefix_ipv4 *p, union sockunion * qgate)
|
|||||||
|
|
||||||
/* Find out if a "selected" RR for the discovered RIB entry exists ever. */
|
/* Find out if a "selected" RR for the discovered RIB entry exists ever. */
|
||||||
for (match = rn->info; match; match = match->next)
|
for (match = rn->info; match; match = match->next)
|
||||||
{
|
{
|
||||||
if (CHECK_FLAG (match->status, RIB_ENTRY_REMOVED))
|
if (CHECK_FLAG (match->status, RIB_ENTRY_REMOVED))
|
||||||
continue;
|
continue;
|
||||||
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* None such found :( */
|
/* None such found :( */
|
||||||
if (!match)
|
if (!match)
|
||||||
@ -735,8 +750,12 @@ rib_match_ipv6 (struct in6_addr *addr)
|
|||||||
|
|
||||||
/* Pick up selected route. */
|
/* Pick up selected route. */
|
||||||
for (match = rn->info; match; match = match->next)
|
for (match = rn->info; match; match = match->next)
|
||||||
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
{
|
||||||
break;
|
if (CHECK_FLAG (match->status, RIB_ENTRY_REMOVED))
|
||||||
|
continue;
|
||||||
|
if (CHECK_FLAG (match->flags, ZEBRA_FLAG_SELECTED))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* If there is no selected route or matched route is EGP, go up
|
/* If there is no selected route or matched route is EGP, go up
|
||||||
tree. */
|
tree. */
|
||||||
|
Loading…
Reference in New Issue
Block a user