diff options
| author | Emanuele Di Pascale <emanuele@voltanet.io> | 2019-03-28 17:02:33 +0100 | 
|---|---|---|
| committer | Emanuele Di Pascale <emanuele@voltanet.io> | 2019-03-28 17:02:33 +0100 | 
| commit | 29803d7fcd297c1888eceae648f78fe8b0b46ce3 (patch) | |
| tree | 3c06db27dde3469f67f176c7205ee41da43eccc9 | |
| parent | 0f4dda3f2e1acb264de9a799f79310c3351a7d29 (diff) | |
bgpd: fix show bgp labeled_unicast
while labeled_unicast routes should be fetched in the
unicast table, we cannot set the safi to SAFI_UNICAST
else the peer afc checks and subgroup retrieval will fail
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
| -rw-r--r-- | bgpd/bgp_route.c | 10 | 
1 files changed, 5 insertions, 5 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 9fa0aaa4fd..7d46d5309e 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -10177,7 +10177,11 @@ static void show_adj_route(struct vty *vty, struct peer *peer, afi_t afi,  		return;  	} -	table = bgp->rib[afi][safi]; +	/* labeled-unicast routes live in the unicast table */ +	if (safi == SAFI_LABELED_UNICAST) +		table = bgp->rib[afi][SAFI_UNICAST]; +	else +		table = bgp->rib[afi][safi];  	output_count = filtered_count = 0;  	subgrp = peer_subgroup(peer, afi, safi); @@ -10401,10 +10405,6 @@ static int peer_adj_routes(struct vty *vty, struct peer *peer, afi_t afi,  	if (use_json)  		json = json_object_new_object(); -	/* 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_string_add(  | 
