]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: Skip automatically created BGP instances for show CMDs
authorDonatas Abraitis <donatas@opensourcerouting.org>
Sat, 13 Jul 2024 20:19:57 +0000 (23:19 +0300)
committerMergify <37929162+mergify[bot]@users.noreply.github.com>
Tue, 16 Jul 2024 14:10:07 +0000 (14:10 +0000)
When using e.g. `adverise-all-vni`, and/or `import vrf ...`, the VRF instance
is created with a default's VRF ASN and tagged as AUTO_VRF. We MUST skip them
here also.

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
(cherry picked from commit 03c086866bdee9daf55420b88593345b9eb6be15)

bgpd/bgp_vty.c

index 4c394b6770a45df674d18557baaeaad025709bc8..082dcdeba53caf28dcf1d23985a888b02867947c 100644 (file)
@@ -12621,6 +12621,9 @@ static void bgp_show_all_instances_summary_vty(struct vty *vty, afi_t afi,
                vty_out(vty, "{\n");
 
        for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp)) {
+               if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_AUTO))
+                       continue;
+
                nbr_output = true;
                if (use_json) {
                        if (!is_first)
@@ -16002,6 +16005,9 @@ static void bgp_show_all_instances_neighbors_vty(struct vty *vty,
                vty_out(vty, "{\n");
 
        for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp)) {
+               if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_AUTO))
+                       continue;
+
                nbr_output = true;
                if (use_json) {
                        if (!(json = json_object_new_object())) {
@@ -16561,6 +16567,9 @@ static int bgp_show_all_instance_route_leak_vty(struct vty *vty, afi_t afi,
                if (bgp->inst_type != BGP_INSTANCE_TYPE_DEFAULT)
                        vrf_name = bgp->name;
 
+               if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_AUTO))
+                       continue;
+
                if (use_json) {
                        json_vrf = json_object_new_object();
                } else {
@@ -16651,6 +16660,9 @@ static void bgp_show_all_instances_updgrps_vty(struct vty *vty, afi_t afi,
        struct bgp *bgp;
 
        for (ALL_LIST_ELEMENTS(bm->bgp, node, nnode, bgp)) {
+               if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_AUTO))
+                       continue;
+
                if (!uj)
                        vty_out(vty, "\nInstance %s:\n",
                                (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)