diff options
| author | Russ White <russ@riw.us> | 2024-06-04 07:53:30 -0400 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-04 07:53:30 -0400 | 
| commit | fb4e4b5fb245ff89c7b0d93e223c0d4eba85eb14 (patch) | |
| tree | c93fe5bca2a233fe09278335d6e021f8fee90ea3 /isisd | |
| parent | a24c8050e182efcb1d065e570313684e7ffc24b0 (diff) | |
| parent | 39e27b840e5ddc2087c0b20cfcf379745b3baa79 (diff) | |
Merge pull request #16056 from zhou-run/202405211622
isisd: When the metric-type is configured as "wide", the IS-IS generates incorrect metric values for IPv4 directly connected routes.
Diffstat (limited to 'isisd')
| -rw-r--r-- | isisd/isis_spf.c | 24 | 
1 files changed, 20 insertions, 4 deletions
diff --git a/isisd/isis_spf.c b/isisd/isis_spf.c index e349373372..5366491cee 100644 --- a/isisd/isis_spf.c +++ b/isisd/isis_spf.c @@ -1262,7 +1262,7 @@ static int isis_spf_preload_tent_ip_reach_cb(const struct prefix *prefix,  	struct isis_vertex *parent = args->parent;  	struct prefix_pair ip_info;  	enum vertextype vtype; -	bool has_valid_psid = false; +	bool has_valid_psid = false, transition = false;  	if (external)  		return LSP_ITER_CONTINUE; @@ -1272,10 +1272,17 @@ static int isis_spf_preload_tent_ip_reach_cb(const struct prefix *prefix,  	prefix_copy(&ip_info.dest, prefix);  	apply_mask(&ip_info.dest); -	if (prefix->family == AF_INET) +	if (prefix->family == AF_INET) {  		vtype = VTYPE_IPREACH_INTERNAL; -	else + +		if (spftree->area->newmetric) +			vtype = VTYPE_IPREACH_TE; + +		if (spftree->area->oldmetric && spftree->area->newmetric) +			transition = true; +	} else {  		vtype = VTYPE_IP6REACH_INTERNAL; +	}  	/* Parse list of Prefix-SID subTLVs if SR is enabled */  	if (spftree->area->srdb.enabled && subtlvs) { @@ -1290,6 +1297,11 @@ static int isis_spf_preload_tent_ip_reach_cb(const struct prefix *prefix,  			has_valid_psid = true;  			isis_spf_add_local(spftree, vtype, &ip_info, NULL, 0,  					   psid, parent); +			if (transition) +				isis_spf_add_local(spftree, +						   VTYPE_IPREACH_INTERNAL, +						   &ip_info, NULL, 0, psid, +						   parent);  			/*  			 * Stop the Prefix-SID iteration since we only support @@ -1298,9 +1310,13 @@ static int isis_spf_preload_tent_ip_reach_cb(const struct prefix *prefix,  			break;  		}  	} -	if (!has_valid_psid) +	if (!has_valid_psid) {  		isis_spf_add_local(spftree, vtype, &ip_info, NULL, 0, NULL,  				   parent); +		if (transition) +			isis_spf_add_local(spftree, VTYPE_IPREACH_INTERNAL, +					   &ip_info, NULL, 0, NULL, parent); +	}  	return LSP_ITER_CONTINUE;  }  | 
