Skip to content

Commit

Permalink
Merge pull request FRRouting#16056 from zhou-run/202405211622
Browse files Browse the repository at this point in the history
isisd: When the metric-type is configured as "wide", the IS-IS generates incorrect metric values for IPv4 directly connected routes.
  • Loading branch information
riw777 authored Jun 4, 2024
2 parents a24c805 + 39e27b8 commit fb4e4b5
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 81 deletions.
24 changes: 20 additions & 4 deletions isisd/isis_spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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) {
Expand All @@ -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
Expand All @@ -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;
}
Expand Down
Loading

0 comments on commit fb4e4b5

Please sign in to comment.