Skip to content

Commit

Permalink
isisd: fix building asla at first flex-algo config
Browse files Browse the repository at this point in the history
When an color affinity is set on an interface before configuring the
flex-algorithm, the ASLA (Application Specific Link-Attribute) sub-TLV
is not build. Flex-algo fails to build the paths when a affinity
constraint is required because of the lacking of information contained
in ASLA. There are no problems when the configuration order is reversed.
For example:

> affinity-map red bit-position 1
>
> interface eth2
>  link-params
>   affinity red
>
> router isis 1
>  mpls-te on
>  flex-algo 129
>   dataplane sr-mpls
>   advertise-definition
>   affinity include-any green

In isis_link_params_update_asla(), the ASLA sub-TLV is not build when
the list of flex-algos is empty.

Update ASLA when the first flex-algorithm is configured.

Fixes: 893882e ("isisd: add isis flex-algo configuration backend")
Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
  • Loading branch information
louis-6wind committed Jul 26, 2024
1 parent 9c0e668 commit ae27101
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 10 additions & 1 deletion isisd/isis_nb_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2838,7 +2838,9 @@ int isis_instance_flex_algo_create(struct nb_cb_create_args *args)
{
struct isis_area *area;
struct flex_algo *fa;
bool advertise;
bool advertise, update_te;
struct isis_circuit *circuit;
struct listnode *node;
uint32_t algorithm;
uint32_t priority = FLEX_ALGO_PRIO_DEFAULT;
struct isis_flex_algo_alloc_arg arg;
Expand All @@ -2851,6 +2853,7 @@ int isis_instance_flex_algo_create(struct nb_cb_create_args *args)
area = nb_running_get_entry(args->dnode, NULL, true);
arg.algorithm = algorithm;
arg.area = area;
update_te = list_isempty(area->flex_algos->flex_algos);
fa = flex_algo_alloc(area->flex_algos, algorithm, &arg);
fa->priority = priority;
fa->advertise_definition = advertise;
Expand All @@ -2862,6 +2865,12 @@ int isis_instance_flex_algo_create(struct nb_cb_create_args *args)
admin_group_allow_explicit_zero(
&fa->admin_group_include_all);
}
if (update_te) {
for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node,
circuit))
isis_link_params_update_asla(circuit,
circuit->interface);
}
lsp_regenerate_schedule(area, area->is_type, 0);
break;
case NB_EV_VALIDATE:
Expand Down
4 changes: 2 additions & 2 deletions isisd/isis_te.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ void isis_mpls_te_term(struct isis_area *area)
XFREE(MTYPE_ISIS_MPLS_TE, area->mta);
}

static void isis_link_params_update_asla(struct isis_circuit *circuit,
struct interface *ifp)
void isis_link_params_update_asla(struct isis_circuit *circuit,
struct interface *ifp)
{
struct isis_asla_subtlvs *asla;
struct listnode *node, *nnode;
Expand Down
2 changes: 2 additions & 0 deletions isisd/isis_te.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ void isis_mpls_te_init(void);
void isis_mpls_te_create(struct isis_area *area);
void isis_mpls_te_disable(struct isis_area *area);
void isis_mpls_te_term(struct isis_area *area);
void isis_link_params_update_asla(struct isis_circuit *circuit,
struct interface *ifp);
void isis_link_params_update(struct isis_circuit *, struct interface *);
int isis_mpls_te_update(struct interface *);
void isis_te_lsp_event(struct isis_lsp *lsp, enum lsp_event event);
Expand Down

0 comments on commit ae27101

Please sign in to comment.