diff options
author | Lu Feng <lu.feng@6wind.com> | 2014-07-18 08:13:19 +0200 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2016-05-26 19:12:05 +0200 |
commit | 8478ae7ef3f4ace7470f3bf47780c3d2f7727848 (patch) | |
tree | b1f9868ddf1cbd060494166805bbb1e162607ee8 /ripd/rip_zebra.c | |
parent | ripd: add ECMP support (diff) | |
download | frr-8478ae7ef3f4ace7470f3bf47780c3d2f7727848.tar.xz frr-8478ae7ef3f4ace7470f3bf47780c3d2f7727848.zip |
ripd: allow to enable/disable the ECMP feature
Introduce a new command "[no] allow-ecmp" to enable/disable the
ECMP feature in RIP. By default, ECMP is not allowed.
Once ECMP is disabled, only one route entry can exist in the list.
* rip_zebra.c: adjust a debugging information, which shows the number
of nexthops according to whether ECMP is enabled.
* ripd.c: rip_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, rip_ecmp_disable() is called to
remove the multiple nexthops.
* ripd.h: Add a new member "ecmp" to "struct rip", 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: David Lamparter <equinox@opensourcerouting.org>
(cherry picked from commit 0b74a0a5db7bcf65bf68c44b547b02b1310b5cdb)
Diffstat (limited to 'ripd/rip_zebra.c')
-rw-r--r-- | ripd/rip_zebra.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c index 09a151093..6ca27d01d 100644 --- a/ripd/rip_zebra.c +++ b/ripd/rip_zebra.c @@ -95,10 +95,18 @@ rip_zebra_ipv4_send (struct route_node *rp, u_char cmd) (struct prefix_ipv4 *)&rp->p, &api); if (IS_RIP_DEBUG_ZEBRA) - zlog_debug ("%s: %s/%d nexthops %d", - (cmd == ZEBRA_IPV4_ROUTE_ADD) ? \ - "Install into zebra" : "Delete from zebra", - inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen, count); + { + if (rip->ecmp) + zlog_debug ("%s: %s/%d nexthops %d", + (cmd == ZEBRA_IPV4_ROUTE_ADD) ? \ + "Install into zebra" : "Delete from zebra", + inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen, count); + else + zlog_debug ("%s: %s/%d", + (cmd == ZEBRA_IPV4_ROUTE_ADD) ? \ + "Install into zebra" : "Delete from zebra", + inet_ntoa (rp->p.u.prefix4), rp->p.prefixlen); + } rip_global_route_changes++; } |