From: Donatas Abraitis Date: Tue, 30 Aug 2022 08:46:00 +0000 (+0300) Subject: bgpd: Break immediatelly and print vty_out instead of double checking for JSON X-Git-Tag: base_8.4~78^2~3 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8248a4bc219c1a21147f6591597ff775f7c32fb0;p=mirror%2Ffrr.git bgpd: Break immediatelly and print vty_out instead of double checking for JSON Signed-off-by: Donatas Abraitis --- diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index 4277162339..f6b87dccdb 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -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];