mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 16:04:49 +00:00
zebra: "ip import-table" display is hosed
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Don Slice <dslice@cumulusnetworks.com> Ticket: CM-13020 Now that we have evpn we have the following AFIs /* Address family numbers from RFC1700. */ typedef enum { AFI_IP = 1, AFI_IP6 = 2, AFI_ETHER = 3, /* RFC 1700 has "6" for 802.* */ AFI_MAX = 4 } afi_t; The import-table code was treating the afi as a flag which was fine before when the only choices were 1 and 2 but now that we have #3 that doesn't work. The fix is to change zebra_import_table_used to a [AFI_MAX][ZEBRA_KERNEL_TABLE_MAX] array to track if import-table is enabled.
This commit is contained in:
parent
276887bb1c
commit
032bfaaf28
@ -46,20 +46,14 @@
|
|||||||
|
|
||||||
/* array holding redistribute info about table redistribution */
|
/* array holding redistribute info about table redistribution */
|
||||||
/* bit AFI is set if that AFI is redistributing routes from this table */
|
/* bit AFI is set if that AFI is redistributing routes from this table */
|
||||||
static u_char zebra_import_table_used[ZEBRA_KERNEL_TABLE_MAX];
|
static int zebra_import_table_used[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
|
||||||
static u_int32_t zebra_import_table_distance[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
|
static u_int32_t zebra_import_table_distance[AFI_MAX][ZEBRA_KERNEL_TABLE_MAX];
|
||||||
|
|
||||||
int
|
int
|
||||||
is_zebra_import_table_enabled(afi_t afi, u_int32_t table_id)
|
is_zebra_import_table_enabled(afi_t afi, u_int32_t table_id)
|
||||||
{
|
{
|
||||||
if (is_zebra_valid_kernel_table(table_id))
|
if (is_zebra_valid_kernel_table(table_id))
|
||||||
{
|
return zebra_import_table_used[afi][table_id];
|
||||||
if (CHECK_FLAG(zebra_import_table_used[table_id], (u_char)afi))
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,12 +666,12 @@ zebra_import_table (afi_t afi, u_int32_t table_id, u_int32_t distance, const cha
|
|||||||
zebra_del_import_table_route_map (afi, table_id);
|
zebra_del_import_table_route_map (afi, table_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_FLAG(zebra_import_table_used[table_id], afi);
|
zebra_import_table_used[afi][table_id] = 1;
|
||||||
zebra_import_table_distance[afi][table_id] = distance;
|
zebra_import_table_distance[afi][table_id] = distance;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UNSET_FLAG(zebra_import_table_used[table_id], (u_char)afi);
|
zebra_import_table_used[afi][table_id] = 0;
|
||||||
zebra_import_table_distance[afi][table_id] = ZEBRA_TABLE_DISTANCE_DEFAULT;
|
zebra_import_table_distance[afi][table_id] = ZEBRA_TABLE_DISTANCE_DEFAULT;
|
||||||
|
|
||||||
rmap_name = zebra_get_import_table_route_map (afi, table_id);
|
rmap_name = zebra_get_import_table_route_map (afi, table_id);
|
||||||
@ -721,7 +715,7 @@ zebra_import_table_config (struct vty *vty)
|
|||||||
int i;
|
int i;
|
||||||
afi_t afi;
|
afi_t afi;
|
||||||
int write = 0;
|
int write = 0;
|
||||||
char afi_str[AFI_MAX][6] = {"", "ip", "ipv6"};
|
char afi_str[AFI_MAX][10] = {"", "ip", "ipv6", "ethernet"};
|
||||||
const char *rmap_name;
|
const char *rmap_name;
|
||||||
|
|
||||||
for (afi = AFI_IP; afi < AFI_MAX; afi++)
|
for (afi = AFI_IP; afi < AFI_MAX; afi++)
|
||||||
|
Loading…
Reference in New Issue
Block a user