]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Display afi of the nexthop hash entry
authorDonald Sharp <sharpd@nvidia.com>
Thu, 29 Aug 2024 18:49:36 +0000 (14:49 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Thu, 29 Aug 2024 18:49:36 +0000 (14:49 -0400)
Let's display the afi of the nexthop hash entry.  Right
now it is impossible to tell the difference between v4 or
v6 nexthops, especially since it is important for the kernel.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
zebra/zebra_vty.c

index 3b786e3257c0c870ab43c66834f4f52ce3859db5..91aa4e400b0101791873e2164cc1ca1c2d0e7c77 100644 (file)
@@ -1195,6 +1195,7 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe,
                json_object_string_add(json, "uptime", up_str);
                json_object_string_add(json, "vrf",
                                       vrf_id_to_name(nhe->vrf_id));
+               json_object_string_add(json, "afi", afi2str(nhe->afi));
 
        } else {
                vty_out(vty, "ID: %u (%s)\n", nhe->id,
@@ -1208,7 +1209,8 @@ static void show_nexthop_group_out(struct vty *vty, struct nhg_hash_entry *nhe,
                vty_out(vty, "\n");
 
                vty_out(vty, "     Uptime: %s\n", up_str);
-               vty_out(vty, "     VRF: %s\n", vrf_id_to_name(nhe->vrf_id));
+               vty_out(vty, "     VRF: %s(%s)\n", vrf_id_to_name(nhe->vrf_id),
+                       afi2str(nhe->afi));
        }
 
        if (CHECK_FLAG(nhe->flags, NEXTHOP_GROUP_VALID)) {