diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-07-16 20:28:43 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-07-16 20:28:43 -0700 |
commit | deaccb3d66b902bb3523c451af6d408dd2b32656 (patch) | |
tree | bb223458be6a79e9659f13f062eb21bee6c37ba5 /zebra/zebra_rib.c | |
parent | 3aac65b9a15741f1cd7f2bc785a0fdb0c56ab4e4 (diff) | |
download | quagga-deaccb3d66b902bb3523c451af6d408dd2b32656.tar.bz2 quagga-deaccb3d66b902bb3523c451af6d408dd2b32656.tar.xz |
Update recursive route when nexthop changes
This includes two fixes. First entries that are marked for removal
should not be used (clear SELECTED flag). Also, when recursive route
changes, the CHANGED flag needs to be set to force update.
Bugfix 3434
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r-- | zebra/zebra_rib.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 92236b6d..28f88c51 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -433,8 +433,7 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, match->type == ZEBRA_ROUTE_STATIC) { for (newhop = match->nexthop; newhop; newhop = newhop->next) - if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB) - && ! CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_RECURSIVE)) + if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB)) { if (set) { @@ -448,6 +447,8 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, || newhop->type == NEXTHOP_TYPE_IPV4_IFINDEX) nexthop->rifindex = newhop->ifindex; } + else if (newhop != nexthop) + SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); if (newhop->type == NEXTHOP_TYPE_IFINDEX) { @@ -565,8 +566,7 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set, else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL)) { for (newhop = match->nexthop; newhop; newhop = newhop->next) - if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB) - && ! CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_RECURSIVE)) + if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB)) { if (set) { @@ -582,6 +582,8 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set, || newhop->type == NEXTHOP_TYPE_IPV6_IFNAME) nexthop->rifindex = newhop->ifindex; } + else if (newhop != nexthop) + SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); if (newhop && newhop->type == NEXTHOP_TYPE_IFINDEX) { @@ -1477,6 +1479,7 @@ rib_delnode (struct route_node *rn, struct rib *rib) zlog_debug ("%s: %s/%d: rn %p, rib %p, removing", __func__, buf, rn->p.prefixlen, rn, rib); } + UNSET_FLAG (rib->flags, ZEBRA_FLAG_SELECTED); SET_FLAG (rib->status, RIB_ENTRY_REMOVED); rib_queue_add (&zebrad, rn); } |