isisd: verify metrics on metric-style transition
When switching to metric-style transition, circuit metrics should also be
verified to be in the narrow range 0..63.
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/isisd/isisd.c b/isisd/isisd.c
index 28cd051..ce6a262 100644
--- a/isisd/isisd.c
+++ b/isisd/isisd.c
@@ -2092,19 +2092,22 @@
area->newmetric = 1;
area->oldmetric = 0;
}
- else if (strncmp (argv[0], "t", 1) == 0)
- {
- area->newmetric = 1;
- area->oldmetric = 1;
- }
- else if (strncmp (argv[0], "n", 1) == 0)
+ else
{
ret = validate_metric_style_narrow (vty, area);
if (ret != CMD_SUCCESS)
return ret;
- area->newmetric = 0;
- area->oldmetric = 1;
+ if (strncmp (argv[0], "t", 1) == 0)
+ {
+ area->newmetric = 1;
+ area->oldmetric = 1;
+ }
+ else if (strncmp (argv[0], "n", 1) == 0)
+ {
+ area->newmetric = 0;
+ area->oldmetric = 1;
+ }
}
return CMD_SUCCESS;