ripngd: allow to enable/disable the ECMP feature
Introduce a new command "[no] allow-ecmp" to enable/disable the
ECMP feature in RIPng. By default, ECMP is not allowed.
Once ECMP is disabled, only one route entry can exist in the list.
* ripng_zebra.c: adjust a debugging information, which shows the number
of nexthops according to whether ECMP is enabled.
* ripngd.c: ripng_ecmp_add() will reject the new route if ECMP is not
allowed and some entry already exists.
A new configurable command "allow-ecmp" is added to control
whether ECMP is allowed.
When ECMP is disabled, ripng_ecmp_disable() is called to
remove the multiple nexthops.
* ripngd.h: Add a new member "ecmp" to "struct ripng", indicating whether
ECMP is allowed or not.
Signed-off-by: Feng Lu <lu.feng@6wind.com>
Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: Vincent Jardin <vincent.jardin@6wind.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/ripngd/ripng_zebra.c b/ripngd/ripng_zebra.c
index b5cf445..5d383fa 100644
--- a/ripngd/ripng_zebra.c
+++ b/ripngd/ripng_zebra.c
@@ -102,10 +102,18 @@
(struct prefix_ipv6 *)&rp->p, &api);
if (IS_RIPNG_DEBUG_ZEBRA)
- zlog_debug ("%s: %s/%d nexthops %d",
- (cmd == ZEBRA_IPV6_ROUTE_ADD) ? \
- "Install into zebra" : "Delete from zebra",
- inet6_ntoa (rp->p.u.prefix6), rp->p.prefixlen, count);
+ {
+ if (ripng->ecmp)
+ zlog_debug ("%s: %s/%d nexthops %d",
+ (cmd == ZEBRA_IPV6_ROUTE_ADD) ? \
+ "Install into zebra" : "Delete from zebra",
+ inet6_ntoa (rp->p.u.prefix6), rp->p.prefixlen, count);
+ else
+ zlog_debug ("%s: %s/%d",
+ (cmd == ZEBRA_IPV6_ROUTE_ADD) ? \
+ "Install into zebra" : "Delete from zebra",
+ inet6_ntoa (rp->p.u.prefix6), rp->p.prefixlen);
+ }
}
}