Skip to content

Commit

Permalink
isisd: simplify node Sid handling
Browse files Browse the repository at this point in the history
Centralize the n-flag-clear processing to a single point.

Signed-off-by: Fredi Raspall <fredi@voltanet.io>
  • Loading branch information
Fredi-raspall committed May 18, 2021
1 parent 8f6a0d6 commit 249c445
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions isisd/isis_sr.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ struct sr_prefix_cfg *isis_sr_cfg_prefix_add(struct isis_area *area,
pcfg->last_hop_behavior = yang_get_default_enum(
"%s/prefix-sid-map/prefix-sid/last-hop-behavior", ISIS_SR);

/* Set the N-flag when appropriate. */
/* Mark as node Sid if the prefix is host and configured in loopback */
ifp = if_lookup_prefix(prefix, VRF_DEFAULT);
if (ifp && sr_prefix_is_node_sid(ifp, prefix) && !pcfg->n_flag_clear)
if (ifp && sr_prefix_is_node_sid(ifp, prefix))
pcfg->node_sid = true;

/* Save prefix-sid configuration. */
Expand Down Expand Up @@ -948,8 +948,7 @@ static int sr_if_new_hook(struct interface *ifp)
if (!pcfg)
continue;

if (sr_prefix_is_node_sid(ifp, &pcfg->prefix)
&& !pcfg->n_flag_clear) {
if (sr_prefix_is_node_sid(ifp, &pcfg->prefix)) {
pcfg->node_sid = true;
lsp_regenerate_schedule(area, area->is_type, 0);
}
Expand Down

0 comments on commit 249c445

Please sign in to comment.