static int static_ifp_up(struct interface *ifp)
{
- if (if_is_vrf(ifp)) {
- struct static_vrf *svrf = static_vrf_lookup_by_id(ifp->vrf_id);
-
- static_fixup_vrf_ids(svrf);
- }
-
/* Install any static reliant on this interface coming up */
static_install_intf_nh(ifp);
static_ifindex_update(ifp, true);
static_nexthop_is_local(vrf_id_t vrfid, struct prefix *addr, int family)
{
if (family == AF_INET) {
- if (if_lookup_exact_address(&addr->u.prefix4,
- AF_INET,
- vrfid))
+ if (if_address_is_local(&addr->u.prefix4, AF_INET, vrfid))
return true;
} else if (family == AF_INET6) {
- if (if_lookup_exact_address(&addr->u.prefix6,
- AF_INET6,
- vrfid))
+ if (if_address_is_local(&addr->u.prefix6, AF_INET6, vrfid))
return true;
}
return false;
static void static_zebra_capabilities(struct zclient_capabilities *cap)
{
mpls_enabled = cap->mpls_enabled;
+ zebra_ecmp_count = cap->ecmp;
}
static unsigned int static_nht_hash_key(const void *data)
api.tableid = pn->table_id;
}
frr_each(static_nexthop_list, &pn->nexthop_list, nh) {
+ /* Don't overrun the nexthop array */
+ if (nh_num == zebra_ecmp_count)
+ break;
+
api_nh = &api.nexthops[nh_num];
if (nh->nh_vrf_id == VRF_UNKNOWN)
continue;