summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2018-01-30 03:03:08 +0100
committerChirag Shah <chirag@cumulusnetworks.com>2018-01-30 06:33:32 +0100
commit951da4357187f3206d434a6887beafc475ad631e (patch)
tree7471f7f05a4e8e8e4e1e9e322a030201498d8cd7 /ospfd
parentMerge pull request #1686 from donaldsharp/mem_leaks_zebra (diff)
downloadfrr-951da4357187f3206d434a6887beafc475ad631e.tar.xz
frr-951da4357187f3206d434a6887beafc475ad631e.zip
ospfd: Fix default-info and redis cmd options
Fix default-information parsing of metric-type, route-map. show running to display metic-type 2. metric, metric-type and route-map can be configured in any order, running-config displays in specific order.. Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_vty.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c
index cac35c1ec..c923a6f35 100644
--- a/ospfd/ospf_vty.c
+++ b/ospfd/ospf_vty.c
@@ -8160,11 +8160,13 @@ DEFUN (ospf_redistribute_source,
if (!str2metric(argv[idx]->arg, &metric))
return CMD_WARNING_CONFIG_FAILED;
}
+ idx = 1;
/* Get metric type. */
if (argv_find(argv, argc, "(1-2)", &idx)) {
if (!str2metric_type(argv[idx]->arg, &type))
return CMD_WARNING_CONFIG_FAILED;
}
+ idx = 1;
/* Get route-map */
if (argv_find(argv, argc, "WORD", &idx)) {
ospf_routemap_set(red, argv[idx]->arg);
@@ -8389,16 +8391,19 @@ DEFUN (ospf_default_information_originate,
/* Check whether "always" was specified */
if (argv_find(argv, argc, "always", &idx))
default_originate = DEFAULT_ORIGINATE_ALWAYS;
+ idx = 1;
/* Get metric value */
if (argv_find(argv, argc, "(0-16777214)", &idx)) {
if (!str2metric(argv[idx]->arg, &metric))
return CMD_WARNING_CONFIG_FAILED;
}
+ idx = 1;
/* Get metric type. */
if (argv_find(argv, argc, "(1-2)", &idx)) {
if (!str2metric_type(argv[idx]->arg, &type))
return CMD_WARNING_CONFIG_FAILED;
}
+ idx = 1;
/* Get route-map */
if (argv_find(argv, argc, "WORD", &idx))
ospf_routemap_set(red, argv[idx]->arg);
@@ -10231,8 +10236,12 @@ static int config_write_ospf_distribute(struct vty *vty, struct ospf *ospf)
if (red->dmetric.value >= 0)
vty_out(vty, " metric %d",
red->dmetric.value);
+
if (red->dmetric.type == EXTERNAL_METRIC_TYPE_1)
vty_out(vty, " metric-type 1");
+ else if (red->dmetric.type ==
+ EXTERNAL_METRIC_TYPE_2)
+ vty_out(vty, " metric-type 2");
if (ROUTEMAP_NAME(red))
vty_out(vty, " route-map %s",