]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Fix `show bgp nexthop A.B.C.D`
authorDonald Sharp <sharpd@nvidia.com>
Fri, 30 Sep 2022 18:58:21 +0000 (14:58 -0400)
committerDonald Sharp <sharpd@nvidia.com>
Fri, 30 Sep 2022 18:58:21 +0000 (14:58 -0400)
The issuing of `show bgp nexthop A.B.C.D` fails even if that
nexthop exists:

eva# show bgp nexthop 192.168.119.120
specified nexthop does not have entry

Fixed:

eva# show bgp nexthop 192.168.119.120
 192.168.119.120 valid [IGP metric 0], #paths 0, peer 192.168.119.120
  if enp39s0
  Last update: Fri Sep 30 14:55:13 2022

  Paths:

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

index 7867860cbfbd01760bb63ea78e0a2de9a765265b..59b31072b5263dbd1cac195da86e34dbb37a8eaa 100644 (file)
@@ -919,7 +919,7 @@ static int show_ip_bgp_nexthop_table(struct vty *vty, const char *name,
                }
                tree = import_table ? &bgp->import_check_table
                                    : &bgp->nexthop_cache_table;
-               bnc = bnc_find(tree[family2afi(nhop.family)], &nhop, 0, 0);
+               bnc = bnc_find(&(*tree)[family2afi(nhop.family)], &nhop, 0, 0);
                if (!bnc) {
                        vty_out(vty, "specified nexthop does not have entry\n");
                        return CMD_SUCCESS;