From f89a449b5f109668bfcbc823db855244dfa7e170 Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Sun, 11 Feb 2018 20:17:11 -0800 Subject: [PATCH 1/2] ospf6d: Fix distance command Reset prevoiusly configured distance command options if user enters new (different) parameters. Ticket:CM-19635 Reviewed By: Testing Done: R1(config-ospf6)# distance ospf6 intra-area 55 external 55 R1#show running-config ospf6d router ospf6 distance ospf6 intra-area 55 external 55 R1(config-ospf6)# distance ospf6 inter-area 55 R1#show running-config ospf6d router ospf6 distance ospf6 inter-area 55 Signed-off-by: Chirag Shah --- ospf6d/ospf6_top.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ospf6d/ospf6_top.c b/ospf6d/ospf6_top.c index 749873bcf8..450be5d448 100644 --- a/ospf6d/ospf6_top.c +++ b/ospf6d/ospf6_top.c @@ -521,6 +521,10 @@ DEFUN (ospf6_distance_ospf6, VTY_DECLVAR_CONTEXT(ospf6, o); int idx = 0; + o->distance_intra = 0; + o->distance_inter = 0; + o->distance_external = 0; + if (argv_find(argv, argc, "intra-area", &idx)) o->distance_intra = atoi(argv[idx + 1]->arg); idx = 0; From 926b88f00d0391d1356753fcbdb1983bff2ef79d Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Sun, 11 Feb 2018 20:27:43 -0800 Subject: [PATCH 2/2] ospfd: Fix distance command Reset prevoiusly configured distance command options if user enters new (different) parameters. Ticket:CM-19635 Testing Done: R1(config-router)# distance ospf intra-area 45 external 45 R1# show running-config ospfd router ospf distance ospf intra-area 45 external 45 R1(config-router)# distance ospf inter-area 45 R1# show running-config ospfd router ospf distance ospf inter-area 45 Signed-off-by: Chirag Shah --- ospfd/ospf_vty.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 1276f5477c..09350b45a8 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -8558,6 +8558,10 @@ DEFUN (ospf_distance_ospf, VTY_DECLVAR_INSTANCE_CONTEXT(ospf, ospf); int idx = 0; + ospf->distance_intra = 0; + ospf->distance_inter = 0; + ospf->distance_external = 0; + if (argv_find(argv, argc, "intra-area", &idx)) ospf->distance_intra = atoi(argv[idx + 1]->arg); idx = 0;