diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 229e9af91f..8977b1651a 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -12996,10 +12996,6 @@ static int bgp_show_neighbor_route(struct vty *vty, struct peer *peer, if (use_json) SET_FLAG(show_flags, BGP_SHOW_OPT_JSON); - /* labeled-unicast routes live in the unicast table */ - if (safi == SAFI_LABELED_UNICAST) - safi = SAFI_UNICAST; - if (!peer || !peer->afc[afi][safi]) { if (use_json) { json_object *json_no = NULL; @@ -13015,6 +13011,10 @@ static int bgp_show_neighbor_route(struct vty *vty, struct peer *peer, return CMD_WARNING; } + /* labeled-unicast routes live in the unicast table */ + if (safi == SAFI_LABELED_UNICAST) + safi = SAFI_UNICAST; + return bgp_show(vty, peer->bgp, afi, safi, type, &peer->su, show_flags); }