From 8f6a0d6402abc47cbadcbad75698237fd905e6bb Mon Sep 17 00:00:00 2001 From: Fredi Raspall Date: Sun, 2 May 2021 17:13:11 +0200 Subject: isisd: clear the N-flag in ext. reachability TLVs If the n-flag-clear option is set in the configuration of a prefix segment, clear the flag in the extended ip reachability TLVs. RFCs 7794 and 8667 are not too strict on the setting / clearing the N-flag in prefix SIDs. However, if there exists a cmd line option to clear it, it should be cleared in the TLVs announced, as other vendors do. Signed-off-by: Fredi Raspall --- isisd/isis_sr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index c4024772f..4ea20cd32 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -438,7 +438,7 @@ void isis_sr_prefix_cfg2subtlv(const struct sr_prefix_cfg *pcfg, bool external, } if (external) SET_FLAG(psid->flags, ISIS_PREFIX_SID_READVERTISED); - if (pcfg->node_sid) + if (pcfg->node_sid && !pcfg->n_flag_clear) SET_FLAG(psid->flags, ISIS_PREFIX_SID_NODE); /* Set SID value. */ -- cgit v1.2.3 From 249c4457838a27c026af3ab7fa5d66a21325aae7 Mon Sep 17 00:00:00 2001 From: Fredi Raspall Date: Tue, 18 May 2021 10:37:28 +0200 Subject: isisd: simplify node Sid handling Centralize the n-flag-clear processing to a single point. Signed-off-by: Fredi Raspall --- isisd/isis_sr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/isisd/isis_sr.c b/isisd/isis_sr.c index 4ea20cd32..f7cef43d0 100644 --- a/isisd/isis_sr.c +++ b/isisd/isis_sr.c @@ -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. */ @@ -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); } -- cgit v1.2.3