]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: add missing vrf/view parameter to one command
authorIgor Ryzhov <iryzhov@nfware.com>
Thu, 7 Oct 2021 15:29:22 +0000 (18:29 +0300)
committerIgor Ryzhov <iryzhov@nfware.com>
Thu, 7 Oct 2021 15:29:22 +0000 (18:29 +0300)
"show bgp neighbors PEER received prefix-filter" misses the argument.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
bgpd/bgp_route.c
doc/user/bgp.rst

index fc971784500696c5bf97163f58190bc79bed46d9..1111f867c4d32f952a6f261d8561de8661bfab9d 100644 (file)
@@ -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 [<ipv4|ipv6> [unicast]] neighbors <A.B.C.D|X:X::X:X|WORD> received prefix-filter [json]",
+       "show [ip] bgp [<view|vrf> VIEWVRFNAME] [<ipv4|ipv6> [unicast]] neighbors <A.B.C.D|X:X::X:X|WORD> 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;
-       /* [<ipv4|ipv6> [unicast]] */
-       if (argv_find(argv, argc, "ipv4", &idx))
-               afi = AFI_IP;
-       if (argv_find(argv, argc, "ipv6", &idx))
-               afi = AFI_IP6;
        /* neighbors <A.B.C.D|X:X::X:X|WORD> */
        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);
index d37c2b668280b8f58876b0780fb5522f93258c3f..5fcddafaaad233436c541ff9fa015fcbedb30098 100644 (file)
@@ -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 [<view|vrf> 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