]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: make show bgp labeled-unicast work
authorMark Stapp <mstapp@nvidia.com>
Tue, 21 Sep 2021 14:37:39 +0000 (10:37 -0400)
committermergify-bot <noreply@mergify.io>
Wed, 22 Sep 2021 06:52:52 +0000 (06:52 +0000)
Yet-another path where the safi needs to be changed to locate
the unicast table where LU routes live.

Signed-off-by: Mark Stapp <mstapp@nvidia.com>
(cherry picked from commit cd8c2a27c1c7b183c36f0de906d400529a18d652)

bgpd/bgp_route.c

index f79f16c7367139a9313b41b58a8c53616ba093be..18272e10dc3fbe79cef3896f23e88a00b913cfee 100644 (file)
@@ -10852,6 +10852,10 @@ static int bgp_show(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
                return CMD_WARNING;
        }
 
+       /* Labeled-unicast routes live in the unicast table. */
+       if (safi == SAFI_LABELED_UNICAST)
+               safi = SAFI_UNICAST;
+
        table = bgp->rib[afi][safi];
        /* use MPLS and ENCAP specific shows until they are merged */
        if (safi == SAFI_MPLS_VPN) {
@@ -10864,9 +10868,6 @@ static int bgp_show(struct vty *vty, struct bgp *bgp, afi_t afi, safi_t safi,
                                               output_arg, use_json,
                                               1, NULL, NULL);
        }
-       /* labeled-unicast routes live in the unicast table */
-       else if (safi == SAFI_LABELED_UNICAST)
-               safi = SAFI_UNICAST;
 
        return bgp_show_table(vty, bgp, safi, table, type, output_arg, NULL, 1,
                              NULL, NULL, &json_header_depth, show_flags,