Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isisd: (test1)When the metric-type is configured as "wide" #10

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions isisd/isis_spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,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 @@ -1275,10 +1275,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 @@ -1293,6 +1300,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 @@ -1301,9 +1313,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
150 changes: 75 additions & 75 deletions tests/isisd/test_isis_spf.refout

Large diffs are not rendered by default.

20 changes: 0 additions & 20 deletions tests/topotests/isis_lsp_bits_topo1/rt1/step1/show_ip_route.ref
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,5 @@
}
]
}
],
"10.0.1.0\/24":[
{
"prefix":"10.0.1.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceName":"eth-sw1"
},
{
"ip":"10.0.1.3",
"afi":"ipv4",
"interfaceName":"eth-sw1"
}
]
}
]
}
20 changes: 0 additions & 20 deletions tests/topotests/isis_lsp_bits_topo1/rt1/step2/show_ip_route.ref
Original file line number Diff line number Diff line change
Expand Up @@ -58,25 +58,5 @@
}
]
}
],
"10.0.1.0\/24":[
{
"prefix":"10.0.1.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceName":"eth-sw1"
},
{
"ip":"10.0.1.3",
"afi":"ipv4",
"interfaceName":"eth-sw1"
}
]
}
]
}
20 changes: 0 additions & 20 deletions tests/topotests/isis_lsp_bits_topo1/rt1/step3/show_ip_route.ref
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,5 @@
}
]
}
],
"10.0.1.0\/24":[
{
"prefix":"10.0.1.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceName":"eth-sw1"
},
{
"ip":"10.0.1.3",
"afi":"ipv4",
"interfaceName":"eth-sw1"
}
]
}
]
}
20 changes: 0 additions & 20 deletions tests/topotests/isis_lsp_bits_topo1/rt1/step4/show_ip_route.ref
Original file line number Diff line number Diff line change
Expand Up @@ -65,25 +65,5 @@
}
]
}
],
"10.0.1.0\/24":[
{
"prefix":"10.0.1.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceName":"eth-sw1"
},
{
"ip":"10.0.1.3",
"afi":"ipv4",
"interfaceName":"eth-sw1"
}
]
}
]
}
35 changes: 0 additions & 35 deletions tests/topotests/isis_lsp_bits_topo1/rt2/step1/show_ip_route.ref
Original file line number Diff line number Diff line change
Expand Up @@ -38,40 +38,5 @@
}
]
}
],
"10.0.1.0\/24":[
{
"prefix":"10.0.1.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.1.1",
"afi":"ipv4",
"interfaceName":"eth-sw1"
},
{
"ip":"10.0.1.3",
"afi":"ipv4",
"interfaceName":"eth-sw1"
}
]
}
],
"10.0.2.0\/24":[
{
"prefix":"10.0.2.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.2.4",
"afi":"ipv4",
"interfaceName":"eth-rt4"
}
]
}
]
}
35 changes: 0 additions & 35 deletions tests/topotests/isis_lsp_bits_topo1/rt3/step1/show_ip_route.ref
Original file line number Diff line number Diff line change
Expand Up @@ -58,40 +58,5 @@
}
]
}
],
"10.0.1.0\/24":[
{
"prefix":"10.0.1.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.1.1",
"afi":"ipv4",
"interfaceName":"eth-sw1"
},
{
"ip":"10.0.1.2",
"afi":"ipv4",
"interfaceName":"eth-sw1"
}
]
}
],
"10.0.4.0\/24":[
{
"prefix":"10.0.4.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.4.5",
"afi":"ipv4",
"interfaceName":"eth-rt5"
}
]
}
]
}
45 changes: 0 additions & 45 deletions tests/topotests/isis_lsp_bits_topo1/rt4/step1/show_ip_route.ref
Original file line number Diff line number Diff line change
Expand Up @@ -19,51 +19,6 @@
]
}
],
"10.0.2.0\/24":[
{
"prefix":"10.0.2.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.2.2",
"afi":"ipv4",
"interfaceName":"eth-rt2"
}
]
}
],
"10.0.6.0\/24":[
{
"prefix":"10.0.6.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.6.5",
"afi":"ipv4",
"interfaceName":"eth-rt5"
}
]
}
],
"10.0.7.0\/24":[
{
"prefix":"10.0.7.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.7.6",
"afi":"ipv4",
"interfaceName":"eth-rt6"
}
]
}
],
"10.0.8.0\/24":[
{
"prefix":"10.0.8.0\/24",
Expand Down
46 changes: 0 additions & 46 deletions tests/topotests/isis_lsp_bits_topo1/rt5/step1/show_ip_route.ref
Original file line number Diff line number Diff line change
Expand Up @@ -39,36 +39,6 @@
]
}
],
"10.0.4.0\/24":[
{
"prefix":"10.0.4.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.4.3",
"afi":"ipv4",
"interfaceName":"eth-rt3"
}
]
}
],
"10.0.6.0\/24":[
{
"prefix":"10.0.6.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.6.4",
"afi":"ipv4",
"interfaceName":"eth-rt4"
}
]
}
],
"10.0.7.0\/24":[
{
"prefix":"10.0.7.0\/24",
Expand Down Expand Up @@ -96,21 +66,5 @@
}
]
}
],
"10.0.8.0\/24":[
{
"prefix":"10.0.8.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.8.6",
"afi":"ipv4",
"interfaceName":"eth-rt6",
"weight":1
}
]
}
]
}
30 changes: 0 additions & 30 deletions tests/topotests/isis_lsp_bits_topo1/rt6/step1/show_ip_route.ref
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,5 @@
}
]
}
],
"10.0.7.0\/24":[
{
"prefix":"10.0.7.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.7.4",
"afi":"ipv4",
"interfaceName":"eth-rt4"
}
]
}
],
"10.0.8.0\/24":[
{
"prefix":"10.0.8.0\/24",
"protocol":"isis",
"distance":115,
"metric":20,
"nexthops":[
{
"ip":"10.0.8.5",
"afi":"ipv4",
"interfaceName":"eth-rt5"
}
]
}
]
}
Loading
Loading