summaryrefslogtreecommitdiff
path: root/ripngd/ripng_zebra.c
diff options
context:
space:
mode:
Diffstat (limited to 'ripngd/ripng_zebra.c')
-rw-r--r--ripngd/ripng_zebra.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c
index d974d65df5..bb5a880c02 100644
--- a/ripngd/ripng_zebra.c
+++ b/ripngd/ripng_zebra.c
@@ -30,7 +30,7 @@ static void ripng_zebra_ipv6_send(struct ripng *ripng, struct agg_node *rp,
struct zapi_nexthop *api_nh;
struct listnode *listnode = NULL;
struct ripng_info *rinfo = NULL;
- int count = 0;
+ uint32_t count = 0;
const struct prefix *p = agg_node_get_prefix(rp);
memset(&api, 0, sizeof(api));
@@ -41,7 +41,7 @@ static void ripng_zebra_ipv6_send(struct ripng *ripng, struct agg_node *rp,
SET_FLAG(api.message, ZAPI_MESSAGE_NEXTHOP);
for (ALL_LIST_ELEMENTS_RO(list, listnode, rinfo)) {
- if (count >= MULTIPATH_NUM)
+ if (count >= zebra_ecmp_count)
break;
api_nh = &api.nexthops[count];
api_nh->vrf_id = ripng->vrf->vrf_id;
@@ -222,11 +222,15 @@ static void ripng_zebra_connected(struct zclient *zclient)
static zclient_handler *const ripng_handlers[] = {
[ZEBRA_INTERFACE_ADDRESS_ADD] = ripng_interface_address_add,
[ZEBRA_INTERFACE_ADDRESS_DELETE] = ripng_interface_address_delete,
- [ZEBRA_INTERFACE_VRF_UPDATE] = ripng_interface_vrf_update,
[ZEBRA_REDISTRIBUTE_ROUTE_ADD] = ripng_zebra_read_route,
[ZEBRA_REDISTRIBUTE_ROUTE_DEL] = ripng_zebra_read_route,
};
+static void ripng_zebra_capabilities(struct zclient_capabilities *cap)
+{
+ zebra_ecmp_count = MIN(cap->ecmp, zebra_ecmp_count);
+}
+
/* Initialize zebra structure and it's commands. */
void zebra_init(struct event_loop *master)
{
@@ -236,6 +240,7 @@ void zebra_init(struct event_loop *master)
zclient_init(zclient, ZEBRA_ROUTE_RIPNG, 0, &ripngd_privs);
zclient->zebra_connected = ripng_zebra_connected;
+ zclient->zebra_capabilities = ripng_zebra_capabilities;
}
void ripng_zebra_stop(void)