mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 19:39:28 +00:00
zebra: fix show ip route vrf X summary
The lookup for non default VRFs was always using a tableId; if not provided, we were defaulting to RT_TABLE_MAIN. This is fine for the default VRF but not for others. As a result, the command was silently failing for non-default VRFs unless we also specified the correct tableId. Fix this by only performing the lookup using the tableId if it is provided; else use zebra_vrf_table. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
This commit is contained in:
parent
5c1a899432
commit
265ac74a87
@ -1963,9 +1963,6 @@ DEFPY (show_route_summary,
|
|||||||
struct route_table *table;
|
struct route_table *table;
|
||||||
bool uj = use_json(argc, argv);
|
bool uj = use_json(argc, argv);
|
||||||
|
|
||||||
if (table_id == 0)
|
|
||||||
table_id = RT_TABLE_MAIN;
|
|
||||||
|
|
||||||
if (vrf_all) {
|
if (vrf_all) {
|
||||||
struct vrf *vrf;
|
struct vrf *vrf;
|
||||||
struct zebra_vrf *zvrf;
|
struct zebra_vrf *zvrf;
|
||||||
@ -1974,8 +1971,13 @@ DEFPY (show_route_summary,
|
|||||||
if ((zvrf = vrf->info) == NULL)
|
if ((zvrf = vrf->info) == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
table = zebra_vrf_lookup_table_with_table_id(
|
if (table_id == 0)
|
||||||
afi, SAFI_UNICAST, zvrf->vrf->vrf_id, table_id);
|
table = zebra_vrf_table(afi, SAFI_UNICAST,
|
||||||
|
zvrf->vrf->vrf_id);
|
||||||
|
else
|
||||||
|
table = zebra_vrf_lookup_table_with_table_id(
|
||||||
|
afi, SAFI_UNICAST, zvrf->vrf->vrf_id,
|
||||||
|
table_id);
|
||||||
|
|
||||||
if (!table)
|
if (!table)
|
||||||
continue;
|
continue;
|
||||||
@ -1992,8 +1994,11 @@ DEFPY (show_route_summary,
|
|||||||
if (vrf_name)
|
if (vrf_name)
|
||||||
VRF_GET_ID(vrf_id, vrf_name, false);
|
VRF_GET_ID(vrf_id, vrf_name, false);
|
||||||
|
|
||||||
table = zebra_vrf_lookup_table_with_table_id(afi, SAFI_UNICAST,
|
if (table_id == 0)
|
||||||
vrf_id, table_id);
|
table = zebra_vrf_table(afi, SAFI_UNICAST, vrf_id);
|
||||||
|
else
|
||||||
|
table = zebra_vrf_lookup_table_with_table_id(
|
||||||
|
afi, SAFI_UNICAST, vrf_id, table_id);
|
||||||
if (!table)
|
if (!table)
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user