From: Igor Ryzhov Date: Thu, 7 Oct 2021 15:29:22 +0000 (+0300) Subject: bgpd: add missing vrf/view parameter to one command X-Git-Tag: base_8.2~359^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=d3120452c480c5ac85a3b626df3f64b21bbca2f0;p=matthieu%2Ffrr.git bgpd: add missing vrf/view parameter to one command "show bgp neighbors PEER received prefix-filter" misses the argument. Signed-off-by: Igor Ryzhov --- diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index fc97178450..1111f867c4 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -13961,10 +13961,11 @@ DEFPY (show_ip_bgp_instance_neighbor_advertised_route, DEFUN (show_ip_bgp_neighbor_received_prefix_filter, show_ip_bgp_neighbor_received_prefix_filter_cmd, - "show [ip] bgp [ [unicast]] neighbors received prefix-filter [json]", + "show [ip] bgp [ VIEWVRFNAME] [ [unicast]] neighbors received prefix-filter [json]", SHOW_STR IP_STR BGP_STR + BGP_INSTANCE_HELP_STR "Address Family\n" "Address Family\n" "Address Family modifier\n" @@ -13979,50 +13980,28 @@ DEFUN (show_ip_bgp_neighbor_received_prefix_filter, afi_t afi = AFI_IP6; safi_t safi = SAFI_UNICAST; char *peerstr = NULL; - char name[BUFSIZ]; - union sockunion su; struct peer *peer; - int count, ret; - + int count; int idx = 0; + struct bgp *bgp = NULL; + bool uj = use_json(argc, argv); + + if (uj) + argc--; + + bgp_vty_find_and_parse_afi_safi_bgp(vty, argv, argc, &idx, &afi, &safi, + &bgp, uj); + if (!idx) + return CMD_WARNING; - /* show [ip] bgp */ - if (argv_find(argv, argc, "ip", &idx)) - afi = AFI_IP; - /* [ [unicast]] */ - if (argv_find(argv, argc, "ipv4", &idx)) - afi = AFI_IP; - if (argv_find(argv, argc, "ipv6", &idx)) - afi = AFI_IP6; /* neighbors */ argv_find(argv, argc, "neighbors", &idx); peerstr = argv[++idx]->arg; - bool uj = use_json(argc, argv); - - ret = str2sockunion(peerstr, &su); - if (ret < 0) { - peer = peer_lookup_by_conf_if(NULL, peerstr); - if (!peer) { - if (uj) - vty_out(vty, "{}\n"); - else - vty_out(vty, - "%% Malformed address or name: %s\n", - peerstr); - return CMD_WARNING; - } - } else { - peer = peer_lookup(NULL, &su); - if (!peer) { - if (uj) - vty_out(vty, "{}\n"); - else - vty_out(vty, "No peer\n"); - return CMD_WARNING; - } - } + peer = peer_lookup_in_view(vty, bgp, peerstr, uj); + if (!peer) + return CMD_WARNING; snprintf(name, sizeof(name), "%s.%d.%d", peer->host, afi, safi); count = prefix_bgp_show_prefix_list(NULL, afi, name, uj); diff --git a/doc/user/bgp.rst b/doc/user/bgp.rst index d37c2b6682..5fcddafaaa 100644 --- a/doc/user/bgp.rst +++ b/doc/user/bgp.rst @@ -3540,6 +3540,10 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`. The ``received-routes`` keyword displays all routes belonging to this address-family (prior to inbound policy) that were received by this peer. +.. clicmd:: show bgp [ VIEWVRFNAME] [afi] [safi] neighbors PEER received prefix-filter [json] + + Display Address Prefix ORFs received from this peer. + .. clicmd:: show bgp [afi] [safi] [all] dampening dampened-paths [wide|json] Display paths suppressed due to dampening of the selected afi and safi