From 3c0e16228d61d69c5127e0f4126ee4d4a0741ac7 Mon Sep 17 00:00:00 2001 From: Mark Stapp Date: Fri, 17 Jul 2020 13:10:29 -0400 Subject: zebra: improve vty, simplify some primary/backup code Improve vty output for routes and lsps with backups, including json. Simplify or correct some code that uses both primary and backup nexthops in dplane, nht. Signed-off-by: Mark Stapp --- zebra/zebra_rnh.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) (limited to 'zebra/zebra_rnh.c') diff --git a/zebra/zebra_rnh.c b/zebra/zebra_rnh.c index d1a5cf2a9..9fcd9a33f 100644 --- a/zebra/zebra_rnh.c +++ b/zebra/zebra_rnh.c @@ -1040,22 +1040,10 @@ static bool compare_valid_nexthops(struct route_entry *r1, * backups will be in the 'fib' list. */ nhg1 = rib_get_fib_backup_nhg(r1); - if (nhg1 == zebra_nhg_get_backup_nhg(r1->nhe)) - nhg1 = NULL; - nhg2 = rib_get_fib_backup_nhg(r2); - if (nhg2 == zebra_nhg_get_backup_nhg(r2->nhe)) - nhg2 = NULL; - - if (nhg1) - nh1 = nhg1->nexthop; - else - nh1 = NULL; - if (nhg2) - nh2 = nhg2->nexthop; - else - nh2 = NULL; + nh1 = nhg1->nexthop; + nh2 = nhg2->nexthop; while (1) { /* Find each backup list's next valid nexthop */ @@ -1180,9 +1168,6 @@ static int send_client(struct rnh *rnh, struct zserv *client, } nhg = rib_get_fib_backup_nhg(re); - if (nhg == zebra_nhg_get_backup_nhg(re->nhe)) - nhg = NULL; - if (nhg) { for (ALL_NEXTHOPS_PTR(nhg, nh)) if (rnh_nexthop_valid(re, nh)) { -- cgit v1.2.3