summaryrefslogtreecommitdiff
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
authorMark Stapp <mjs@voltanet.io>2020-02-25 08:29:46 -0500
committerMark Stapp <mjs@voltanet.io>2020-02-27 15:49:31 -0500
commitc415d89528f5cd7128e5b4c4cd65cce01d64fc80 (patch)
treec7604b3cf422eec7f9edd464af522251b7a20d6a /zebra/zebra_vty.c
parentc13bfa74357bdcb719a648b18019dd1151191c10 (diff)
zebra: Embed lib nexthop-group in zebra hash entry
Embed nexthop-group, which is just a pointer, in the zebra nexthop-hash-entry object, rather than mallocing one. Signed-off-by: Mark Stapp <mjs@voltanet.io>
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r--zebra/zebra_vty.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 86ec2ffef3..48bc985118 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -264,7 +264,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->nhe->nhg, nexthop)) {
+ for (ALL_NEXTHOPS(re->nhe->nhg, nexthop)) {
char addrstr[32];
vty_out(vty, " %c%s",
@@ -417,7 +417,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->nhe->nhg;
+ nhg = &(re->nhe->nhg);
if (json) {
json_route = json_object_new_object();
@@ -470,10 +470,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->nhe->nhg));
+ nexthop_group_nexthop_num(&(re->nhe->nhg)));
json_object_int_add(json_route, "internalNextHopActiveNum",
nexthop_group_active_nexthop_num(
- re->nhe->nhg));
+ &(re->nhe->nhg)));
if (uptime < ONE_DAY_SECOND)
sprintf(buf, "%02d:%02d:%02d", tm->tm_hour, tm->tm_min,
tm->tm_sec);
@@ -1149,7 +1149,7 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe)
vty_out(vty, "\n");
}
- for (ALL_NEXTHOPS_PTR(nhe->nhg, nexthop)) {
+ for (ALL_NEXTHOPS(nhe->nhg, nexthop)) {
if (!CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
vty_out(vty, " ");
else
@@ -1970,7 +1970,7 @@ static void vty_show_ip_route_summary_prefix(struct vty *vty,
fib_cnt[ZEBRA_ROUTE_TOTAL]++;
fib_cnt[re->type]++;
}
- for (nexthop = re->nhe->nhg->nexthop; (!cnt && nexthop);
+ for (nexthop = re->nhe->nhg.nexthop; (!cnt && nexthop);
nexthop = nexthop->next) {
cnt++;
rib_cnt[ZEBRA_ROUTE_TOTAL]++;