]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Fix distance command 1742/head
authorChirag Shah <chirag@cumulusnetworks.com>
Mon, 12 Feb 2018 04:27:43 +0000 (20:27 -0800)
committerChirag Shah <chirag@cumulusnetworks.com>
Mon, 12 Feb 2018 05:05:37 +0000 (21:05 -0800)
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 <chirag@cumulusnetworks.com>
ospfd/ospf_vty.c

index 1276f5477c815f606a0ec26d5a80286b6542c6aa..09350b45a857713d77a5199213e62ea8ebc915e7 100644 (file)
@@ -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;