zebra: handle multihop nexthop changes properly
The rib entries are normally added and deleted when they are
changed. However, they are modified in placae when the nexthop
reachability changes. This fixes to:
- properly detect nexthop changes from nexthop_active_update()
calls from rib_process()
- rib_update_kernel() to not reset FIB flags when a RIB entry
is being modifed (old and new RIB are same)
- improves the "show ip route <prefix>" output to display
both ACTIVE and FIB flags for each nexthop
Fixes: 325823a5 "zebra: support FIB override routes"
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Reported-By: Igor Ryzhov <iryzhov@nfware.com>
Tested-by: NetDEF CI System <cisystem@netdef.org>
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 21b92ea..028b744 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -1341,7 +1341,8 @@
for (ALL_NEXTHOPS_RO(rib->nexthop, nexthop, tnexthop, recursing))
{
- vty_out (vty, " %c%s",
+ vty_out (vty, " %c%c%s",
+ CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE) ? '>' : ' ',
CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB) ? '*' : ' ',
recursing ? " " : "");