]> git.puffer.fish Git - mirror/frr.git/commitdiff
bgpd: Break immediatelly and print vty_out instead of double checking for JSON
authorDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 30 Aug 2022 08:46:00 +0000 (11:46 +0300)
committerDonatas Abraitis <donatas@opensourcerouting.org>
Tue, 30 Aug 2022 08:46:00 +0000 (11:46 +0300)
Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
bgpd/bgp_evpn_vty.c

index 4277162339292050583e808298b6f4ccb764668c..f6b87dccdb668006b769697e040d903131e01cf9 100644 (file)
@@ -1012,13 +1012,12 @@ static void show_l3vni_entry(struct vty *vty, struct bgp *bgp,
 
                /* If there are multiple export RTs we break here and show only
                 * one */
-               if (!json)
+               if (!json) {
+                       vty_out(vty, "%-37s", vrf_id_to_name(bgp->vrf_id));
                        break;
+               }
        }
 
-       if (!json)
-               vty_out(vty, "%-37s", vrf_id_to_name(bgp->vrf_id));
-
        if (json) {
                char vni_str[VNI_STR_LEN];
 
@@ -1151,13 +1150,13 @@ static void show_vni_entry(struct hash_bucket *bucket, void *args[])
 
                /* If there are multiple export RTs we break here and show only
                 * one */
-               if (!json)
+               if (!json) {
+                       vty_out(vty, "%-37s",
+                               vrf_id_to_name(vpn->tenant_vrf_id));
                        break;
+               }
        }
 
-       if (!json)
-               vty_out(vty, "%-37s", vrf_id_to_name(vpn->tenant_vrf_id));
-
        if (json) {
                char vni_str[VNI_STR_LEN];