From c3ea390638648112b57b1cb0e445952e1e279f43 Mon Sep 17 00:00:00 2001 From: Christian Franke Date: Sat, 6 May 2017 15:50:41 +0200 Subject: [PATCH] isisd: ensure that MT is only used with wide metrics Signed-off-by: Christian Franke --- isisd/isis_vty.c | 26 ++++++++++++++++++++++++++ isisd/isisd.c | 14 ++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/isisd/isis_vty.c b/isisd/isis_vty.c index 1658ca3733..9cae5f9a5c 100644 --- a/isisd/isis_vty.c +++ b/isisd/isis_vty.c @@ -1284,6 +1284,13 @@ DEFUN (circuit_topology, return CMD_ERR_NO_MATCH; const char *arg = argv[2]->arg; uint16_t mtid = isis_str2mtid(arg); + + if (circuit->area && circuit->area->oldmetric) + { + vty_out (vty, "Multi topology IS-IS can only be used with wide metrics%s", VTY_NEWLINE); + return CMD_ERR_AMBIGUOUS; + } + if (mtid == (uint16_t)-1) { vty_out (vty, "Don't know topology '%s'%s", arg, VTY_NEWLINE); @@ -1306,6 +1313,13 @@ DEFUN (no_circuit_topology, return CMD_ERR_NO_MATCH; const char *arg = argv[3]->arg; uint16_t mtid = isis_str2mtid(arg); + + if (circuit->area && circuit->area->oldmetric) + { + vty_out (vty, "Multi topology IS-IS can only be used with wide metrics%s", VTY_NEWLINE); + return CMD_ERR_AMBIGUOUS; + } + if (mtid == (uint16_t)-1) { vty_out (vty, "Don't know topology '%s'%s", arg, VTY_NEWLINE); @@ -1371,6 +1385,12 @@ DEFUN (metric_style, return CMD_SUCCESS; } + if (area_is_mt(area)) + { + vty_out (vty, "Narrow metrics cannot be used while multi topology IS-IS is active%s", VTY_NEWLINE); + return CMD_ERR_AMBIGUOUS; + } + ret = validate_metric_style_narrow (vty, area); if (ret != CMD_SUCCESS) return ret; @@ -1393,6 +1413,12 @@ DEFUN (no_metric_style, VTY_DECLVAR_CONTEXT (isis_area, area); int ret; + if (area_is_mt(area)) + { + vty_out (vty, "Narrow metrics cannot be used while multi topology IS-IS is active%s", VTY_NEWLINE); + return CMD_ERR_AMBIGUOUS; + } + ret = validate_metric_style_narrow (vty, area); if (ret != CMD_SUCCESS) return ret; diff --git a/isisd/isisd.c b/isisd/isisd.c index 179e430986..d11044377f 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -1669,6 +1669,13 @@ DEFUN (isis_topology, const char *arg = argv[1]->arg; uint16_t mtid = isis_str2mtid(arg); + + if (area->oldmetric) + { + vty_out (vty, "Multi topology IS-IS can only be used with wide metrics%s", VTY_NEWLINE); + return CMD_ERR_AMBIGUOUS; + } + if (mtid == (uint16_t)-1) { vty_out (vty, "Don't know topology '%s'%s", arg, VTY_NEWLINE); @@ -1697,6 +1704,13 @@ DEFUN (no_isis_topology, const char *arg = argv[2]->arg; uint16_t mtid = isis_str2mtid(arg); + + if (area->oldmetric) + { + vty_out (vty, "Multi topology IS-IS can only be used with wide metrics%s", VTY_NEWLINE); + return CMD_ERR_AMBIGUOUS; + } + if (mtid == (uint16_t)-1) { vty_out (vty, "Don't know topology '%s'%s", arg, VTY_NEWLINE); -- 2.39.5