diff options
-rw-r--r-- | debian/changelog | 6 | ||||
-rw-r--r-- | zebra/zebra_rib.c | 37 |
2 files changed, 36 insertions, 7 deletions
diff --git a/debian/changelog b/debian/changelog index b05a1ebf..7a357e07 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +vyatta-quagga (0.99.10-3.3) UNRELEASED; urgency=low + + * Fix handling of recursive routes + + -- Stephen Hemminger <shemminger@vyatta.com> Mon, 22 Dec 2008 16:17:21 -0800 + vyatta-quagga (0.99.10-3.2) UNRELEASED; urgency=low * Ignore address deletion after interface deletion 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; } |