diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-11-19 18:31:41 +0100 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2016-11-19 18:31:41 +0100 |
commit | 7fe3cf138f790e43a180d1dc9910253cfc233cd4 (patch) | |
tree | b17cd94f66886765d7b469448b47cd68651a89cb /zebra/zebra_rnh.c | |
parent | vtysh, zebra: Fix link-params to use exit-link-params (diff) | |
parent | Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga in... (diff) | |
download | frr-7fe3cf138f790e43a180d1dc9910253cfc233cd4.tar.xz frr-7fe3cf138f790e43a180d1dc9910253cfc233cd4.zip |
Merge remote-tracking branch 'origin/cmaster' into cmaster-next
Conflicts:
debian/changelog
zebra/zebra_rnh.c
Diffstat (limited to 'zebra/zebra_rnh.c')
-rw-r--r-- | zebra/zebra_rnh.c | 69 |
1 files changed, 34 insertions, 35 deletions
diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index fdb187a23..8df9277cb 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -543,31 +543,28 @@ zebra_rnh_process_static_routes (vrf_id_t vrfid, int family, RNODE_FOREACH_RIB(static_rn, srib) { if (srib->type == ZEBRA_ROUTE_STATIC) - break; /* currently works for only 1 static route. */ - } + continue; - if (!srib) // unexpected - continue; + /* Set the filter flag for the correct nexthop - static route may + * be having multiple. We care here only about registered nexthops. + */ + for (nexthop = srib->nexthop; nexthop; nexthop = nexthop->next) + { + switch (nexthop->type) + { + case NEXTHOP_TYPE_IPV4: + case NEXTHOP_TYPE_IPV4_IFINDEX: + if (nexthop->gate.ipv4.s_addr == nrn->p.u.prefix4.s_addr) + { + if (num_resolving_nh) + UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FILTERED); + else + SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FILTERED); + } + break; + case NEXTHOP_TYPE_IPV6: + case NEXTHOP_TYPE_IPV6_IFINDEX: - /* Set the filter flag for the correct nexthop - static route may - * be having multiple. We care here only about registered nexthops. - */ - for (nexthop = srib->nexthop; nexthop; nexthop = nexthop->next) - { - switch (nexthop->type) - { - case NEXTHOP_TYPE_IPV4: - case NEXTHOP_TYPE_IPV4_IFINDEX: - if (nexthop->gate.ipv4.s_addr == nrn->p.u.prefix4.s_addr) - { - if (num_resolving_nh) - UNSET_FLAG(nexthop->flags, NEXTHOP_FLAG_FILTERED); - else - SET_FLAG(nexthop->flags, NEXTHOP_FLAG_FILTERED); - } - break; - case NEXTHOP_TYPE_IPV6: - case NEXTHOP_TYPE_IPV6_IFINDEX: if (memcmp(&nexthop->gate.ipv6,&nrn->p.u.prefix6, 16) == 0) { if (num_resolving_nh) @@ -581,20 +578,22 @@ zebra_rnh_process_static_routes (vrf_id_t vrfid, int family, } } - if (IS_ZEBRA_DEBUG_NHT) - { - prefix2str(&static_rn->p, bufs, INET6_ADDRSTRLEN); - if (prn && rib) - zlog_debug("%u:%s: NH change %s, scheduling static route %s", - vrfid, bufn, num_resolving_nh ? - "" : "(filtered by route-map)", bufs); - else - zlog_debug("%u:%s: NH unreachable, scheduling static route %s", - vrfid, bufn, bufs); + if (IS_ZEBRA_DEBUG_NHT) + { + prefix2str(&static_rn->p, bufs, INET6_ADDRSTRLEN); + if (prn && rib) + zlog_debug("%u:%s: NH change %s, scheduling static route %s", + vrfid, bufn, num_resolving_nh ? + "" : "(filtered by route-map)", bufs); + else + zlog_debug("%u:%s: NH unreachable, scheduling static route %s", + vrfid, bufn, bufs); + } + + SET_FLAG(srib->status, RIB_ENTRY_CHANGED); + SET_FLAG(srib->status, RIB_ENTRY_NEXTHOPS_CHANGED); } - SET_FLAG(srib->status, RIB_ENTRY_CHANGED); - SET_FLAG(srib->status, RIB_ENTRY_NEXTHOPS_CHANGED); rib_queue_add(static_rn); } } |