summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2019-11-22 21:30:53 +0100
committerMark Stapp <mjs@voltanet.io>2019-12-04 14:13:52 +0100
commit0eb97b860dc94329cf9add9f8f3d3a2c7f539568 (patch)
tree4382d83b863bbec02b3df6adf9060e7686a7a814 /zebra/zebra_vty.c
parentlib: add some nexthop ctors (diff)
downloadfrr-0eb97b860dc94329cf9add9f8f3d3a2c7f539568.tar.xz
frr-0eb97b860dc94329cf9add9f8f3d3a2c7f539568.zip
lib,zebra: use nhg_hash_entry pointer in route_entry
Replace the existing list of nexthops (via a nexthop_group struct) in the route_entry with a direct pointer to zebra's new shared group (from zebra_nhg.h). This allows more direct access to that shared group and the info it carries. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to '')
-rw-r--r--zebra/zebra_vty.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 12517f313..b0436dd40 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -263,7 +263,7 @@ static void vty_show_ip_route_detail(struct vty *vty, struct route_node *rn,
if (show_ng)
vty_out(vty, " Nexthop Group ID: %u\n", re->nhe_id);
- for (ALL_NEXTHOPS_PTR(re->ng, nexthop)) {
+ for (ALL_NEXTHOPS_PTR(re->nhe->nhg, nexthop)) {
char addrstr[32];
vty_out(vty, " %c%s",
@@ -413,7 +413,7 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
if (is_fib)
nhg = rib_active_nhg(re);
else
- nhg = re->ng;
+ nhg = re->nhe->nhg;
if (json) {
json_route = json_object_new_object();
@@ -466,9 +466,10 @@ static void vty_show_ip_route(struct vty *vty, struct route_node *rn,
json_object_int_add(json_route, "internalFlags",
re->flags);
json_object_int_add(json_route, "internalNextHopNum",
- nexthop_group_nexthop_num(re->ng));
+ nexthop_group_nexthop_num(re->nhe->nhg));
json_object_int_add(json_route, "internalNextHopActiveNum",
- nexthop_group_active_nexthop_num(re->ng));
+ nexthop_group_active_nexthop_num(
+ re->nhe->nhg));
if (uptime < ONE_DAY_SECOND)
sprintf(buf, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min,
tm->tm_sec);
@@ -1833,7 +1834,7 @@ static void vty_show_ip_route_summary_prefix(struct vty *vty,
fib_cnt[ZEBRA_ROUTE_TOTAL]++;
fib_cnt[re->type]++;
}
- for (nexthop = re->ng->nexthop; (!cnt && nexthop);
+ for (nexthop = re->nhe->nhg->nexthop; (!cnt && nexthop);
nexthop = nexthop->next) {
cnt++;
rib_cnt[ZEBRA_ROUTE_TOTAL]++;