Merge pull request #13334 from louis-6wind/flexalgo-fixes

isisd: fixes for Flex-Algo
This commit is contained in:
Olivier Dugeon 2023-04-21 08:58:22 +02:00 committed by GitHub
commit 4dbef8567b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 13 deletions

View file

@ -20,6 +20,9 @@ static bool isis_affinity_map_check_use(const char *affmap_name)
struct affinity_map *map; struct affinity_map *map;
uint16_t pos; uint16_t pos;
if (!isis)
return false;
map = affinity_map_get(affmap_name); map = affinity_map_get(affmap_name);
pos = map->bit_position; pos = map->bit_position;
@ -46,6 +49,9 @@ static void isis_affinity_map_update(const char *affmap_name, uint16_t old_pos,
struct flex_algo *fa; struct flex_algo *fa;
bool changed; bool changed;
if (!isis)
return;
for (ALL_LIST_ELEMENTS_RO(isis->area_list, area_node, area)) { for (ALL_LIST_ELEMENTS_RO(isis->area_list, area_node, area)) {
changed = false; changed = false;
for (ALL_LIST_ELEMENTS_RO(area->flex_algos->flex_algos, fa_node, for (ALL_LIST_ELEMENTS_RO(area->flex_algos->flex_algos, fa_node,

View file

@ -243,8 +243,6 @@ bool isis_flex_algo_constraint_drop(struct isis_spftree *spftree,
{ {
bool ret; bool ret;
struct isis_ext_subtlvs *subtlvs = reach->subtlvs; struct isis_ext_subtlvs *subtlvs = reach->subtlvs;
uint8_t lspid_orig[ISIS_SYS_ID_LEN + 2];
uint8_t lspid_neigh[ISIS_SYS_ID_LEN + 2];
struct isis_router_cap_fad *fad; struct isis_router_cap_fad *fad;
struct isis_asla_subtlvs *asla; struct isis_asla_subtlvs *asla;
struct listnode *node; struct listnode *node;
@ -286,16 +284,12 @@ bool isis_flex_algo_constraint_drop(struct isis_spftree *spftree,
if (link_admin_group && link_ext_admin_group) { if (link_admin_group && link_ext_admin_group) {
link_ext_admin_group_bitmap0 = link_ext_admin_group_bitmap0 =
admin_group_get_offset(link_ext_admin_group, 0); admin_group_get_offset(link_ext_admin_group, 0);
if (*link_admin_group != link_ext_admin_group_bitmap0) { if (*link_admin_group != link_ext_admin_group_bitmap0)
memcpy(lspid_orig, lsp->hdr.lsp_id,
ISIS_SYS_ID_LEN + 2);
memcpy(lspid_neigh, reach->id, ISIS_SYS_ID_LEN + 2);
zlog_warn( zlog_warn(
"ISIS-SPF: LSP from %pLS neighbor %pLS. Admin-group 0x%08x differs from ext admin-group 0x%08x.", "ISIS-SPF: LSP from %pPN neighbor %pPN. Admin-group 0x%08x differs from ext admin-group 0x%08x.",
lspid_orig, lspid_neigh, *link_admin_group, lsp->hdr.lsp_id, reach->id, *link_admin_group,
link_ext_admin_group_bitmap0); link_ext_admin_group_bitmap0);
} }
}
/* /*
* Exclude Any * Exclude Any

View file

@ -2884,6 +2884,7 @@ static void show_isis_route_common(struct vty *vty, int levels,
spftree = area->spftree[SPFTREE_IPV4] spftree = area->spftree[SPFTREE_IPV4]
[level - 1]; [level - 1];
if (!json)
isis_print_spftree(vty, spftree); isis_print_spftree(vty, spftree);
isis_print_routes(vty, spftree, isis_print_routes(vty, spftree,
@ -2905,6 +2906,7 @@ static void show_isis_route_common(struct vty *vty, int levels,
spftree = area->spftree[SPFTREE_IPV6] spftree = area->spftree[SPFTREE_IPV6]
[level - 1]; [level - 1];
if (!json)
isis_print_spftree(vty, spftree); isis_print_spftree(vty, spftree);
isis_print_routes(vty, spftree, isis_print_routes(vty, spftree,
@ -2927,6 +2929,7 @@ static void show_isis_route_common(struct vty *vty, int levels,
spftree = area->spftree[SPFTREE_DSTSRC] spftree = area->spftree[SPFTREE_DSTSRC]
[level - 1]; [level - 1];
if (!json)
isis_print_spftree(vty, spftree); isis_print_spftree(vty, spftree);
isis_print_routes(vty, spftree, isis_print_routes(vty, spftree,
json ? &json_val : NULL, json ? &json_val : NULL,

View file

@ -3144,7 +3144,7 @@ static void area_resign_level(struct isis_area *area, int level)
for (ALL_LIST_ELEMENTS_RO(area->flex_algos->flex_algos, node, for (ALL_LIST_ELEMENTS_RO(area->flex_algos->flex_algos, node,
fa)) { fa)) {
data = fa->data; data = fa->data;
if (data->spftree[level - 1]) { if (data->spftree[tree][level - 1]) {
isis_spftree_del( isis_spftree_del(
data->spftree[tree][level - 1]); data->spftree[tree][level - 1]);
data->spftree[tree][level - 1] = NULL; data->spftree[tree][level - 1] = NULL;