diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-12-22 16:07:24 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-12-22 16:17:34 -0800 |
commit | 5523a025b757c0d8819ca0b75dc218bcdb0ec301 (patch) | |
tree | aaea77ef7136aa53c6fbef16725da79219bd3f7a /zebra | |
parent | d1bd870bf9e1e1da2b0ceeacc542cb71c674faa3 (diff) | |
download | quagga-debian/0.99.10-3.3.tar.bz2 quagga-debian/0.99.10-3.3.tar.xz |
Fix recursive route handlingdebian/0.99.10-3.3
If route type or other index changes flag it as changed.
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/zebra_rib.c | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 69249779..599a4318 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -474,9 +474,20 @@ nexthop_active_ipv4 (struct rib *rib, struct nexthop *nexthop, int set, nexthop->ifindex = newhop->ifindex; } else if (! CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE) - || newhop->ifindex != nexthop->ifindex - || nexthop->gate.ipv4.s_addr != newhop->gate.ipv4.s_addr) - SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); + || nexthop->rtype != newhop->type + || ((newhop->type == NEXTHOP_TYPE_IPV4 || + newhop->type == NEXTHOP_TYPE_IPV4_IFINDEX) && + nexthop->gate.ipv4.s_addr != newhop->gate.ipv4.s_addr) + || ((newhop->type == NEXTHOP_TYPE_IFINDEX + || newhop->type == NEXTHOP_TYPE_IFNAME + || newhop->type == NEXTHOP_TYPE_IPV4_IFINDEX) && + nexthop->rifindex != newhop->ifindex) + || ((nexthop->type == NEXTHOP_TYPE_IPV4) && + nexthop->ifindex != newhop->ifindex)) + { + SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); + } + return 1; } return 0; @@ -603,10 +614,22 @@ nexthop_active_ipv6 (struct rib *rib, struct nexthop *nexthop, int set, nexthop->ifindex = newhop->ifindex; } else if (! CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE) - || newhop->ifindex != nexthop->ifindex - || !IPV6_ADDR_SAME(&nexthop->gate.ipv6, - &newhop->gate.ipv6)) - SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); + || nexthop->rtype != newhop->type + || ((newhop->type == NEXTHOP_TYPE_IPV6 + || newhop->type == NEXTHOP_TYPE_IPV6_IFINDEX + || newhop->type == NEXTHOP_TYPE_IPV6_IFNAME) && + !IPV6_ADDR_SAME (&nexthop->rgate.ipv6, + &newhop->gate.ipv6)) + || ((newhop->type == NEXTHOP_TYPE_IFINDEX + || newhop->type == NEXTHOP_TYPE_IFNAME + || newhop->type == NEXTHOP_TYPE_IPV6_IFINDEX + || newhop->type == NEXTHOP_TYPE_IPV6_IFNAME) && + nexthop->rifindex != newhop->ifindex) + || (nexthop->type == NEXTHOP_TYPE_IPV6) && + nexthop->ifindex != newhop->ifindex) + { + SET_FLAG (rib->flags, ZEBRA_FLAG_CHANGED); + } return 1; } |