summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-12-22 16:07:24 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-12-22 16:07:24 -0800
commit7c675262ade5fef3c49145dd9deca16210e3c95f (patch)
tree74256aa84c458af884f630b222836e0ce33156e2
parentd9730963f05555912e10d8c0d9d811eb10171f1e (diff)
downloadquagga-7c675262ade5fef3c49145dd9deca16210e3c95f.tar.bz2
quagga-7c675262ade5fef3c49145dd9deca16210e3c95f.tar.xz
Fix recursive route handling
If route type or other index changes flag it as changed.
-rw-r--r--zebra/zebra_rib.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 0e9e8a26..205749e4 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;
}