summaryrefslogtreecommitdiffstats
path: root/ospfd/ospfd.c
diff options
context:
space:
mode:
authorChirag Shah <chirag@cumulusnetworks.com>2017-10-07 22:26:13 +0200
committerChirag Shah <chirag@cumulusnetworks.com>2017-10-16 19:02:05 +0200
commit7ef56a7321d475055e7405ed0c61f66676c42b46 (patch)
treee8d052c6da0a00c5dfc26ffe15fb5fbc00892f70 /ospfd/ospfd.c
parentMerge pull request #1313 from LabNConsulting/working/master/patch-set/block-n... (diff)
downloadfrr-7ef56a7321d475055e7405ed0c61f66676c42b46.tar.xz
frr-7ef56a7321d475055e7405ed0c61f66676c42b46.zip
ospfd: fix ospf nssa command
-Fix ordering of nssa command with translate options and no-summary option. Just like ospf stub no-summary keep the order order of nssa no-summary. - Fix NSSA options. - Avoid displaying translate-candiate (default) option in running-config. cumulus(config-router)# area 2.2.2.2 nssa <cr> no-summary Do not inject inter-area routes into nssa translate-always Configure NSSA-ABR to always translate translate-candidate Configure NSSA-ABR for translate election (default) translate-never Configure NSSA-ABR to never translate Running-config output: router ospf area 2.2.2.2 nssa translate-always area 2.2.2.2 nssa no-summary Ticket:CM-8312 Signed-off-by: Chirag Shah <chirag@cumulusnetworks.com>
Diffstat (limited to 'ospfd/ospfd.c')
-rw-r--r--ospfd/ospfd.c44
1 files changed, 36 insertions, 8 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c
index 9e1cf8116..8ee32289c 100644
--- a/ospfd/ospfd.c
+++ b/ospfd/ospfd.c
@@ -1493,7 +1493,7 @@ int ospf_area_no_summary_unset(struct ospf *ospf, struct in_addr area_id)
return 1;
}
-int ospf_area_nssa_set(struct ospf *ospf, struct in_addr area_id)
+int ospf_area_nssa_no_summary_set(struct ospf *ospf, struct in_addr area_id)
{
struct ospf_area *area;
@@ -1504,18 +1504,37 @@ int ospf_area_nssa_set(struct ospf *ospf, struct in_addr area_id)
if (area->external_routing != OSPF_AREA_NSSA) {
ospf_area_type_set(area, OSPF_AREA_NSSA);
ospf->anyNSSA++;
+ area->NSSATranslatorRole = OSPF_NSSA_ROLE_CANDIDATE;
}
- /* set NSSA area defaults */
- area->no_summary = 0;
- area->NSSATranslatorRole = OSPF_NSSA_ROLE_CANDIDATE;
- area->NSSATranslatorState = OSPF_NSSA_TRANSLATE_DISABLED;
- area->NSSATranslatorStabilityInterval = OSPF_NSSA_TRANS_STABLE_DEFAULT;
+ ospf_area_no_summary_set(ospf, area_id);
return 1;
}
-int ospf_area_nssa_unset(struct ospf *ospf, struct in_addr area_id)
+int ospf_area_nssa_set(struct ospf *ospf, struct in_addr area_id)
+{
+ struct ospf_area *area;
+
+ area = ospf_area_get(ospf, area_id);
+ if (ospf_area_vlink_count(ospf, area))
+ return 0;
+
+ if (area->external_routing != OSPF_AREA_NSSA) {
+ ospf_area_type_set(area, OSPF_AREA_NSSA);
+ ospf->anyNSSA++;
+
+ /* set NSSA area defaults */
+ area->no_summary = 0;
+ area->NSSATranslatorRole = OSPF_NSSA_ROLE_CANDIDATE;
+ area->NSSATranslatorState = OSPF_NSSA_TRANSLATE_DISABLED;
+ area->NSSATranslatorStabilityInterval =
+ OSPF_NSSA_TRANS_STABLE_DEFAULT;
+ }
+ return 1;
+}
+
+int ospf_area_nssa_unset(struct ospf *ospf, struct in_addr area_id, int argc)
{
struct ospf_area *area;
@@ -1523,9 +1542,18 @@ int ospf_area_nssa_unset(struct ospf *ospf, struct in_addr area_id)
if (area == NULL)
return 0;
- if (area->external_routing == OSPF_AREA_NSSA) {
+ /* argc < 5 -> 'no area x nssa' */
+ if (argc < 5 && area->external_routing == OSPF_AREA_NSSA) {
ospf->anyNSSA--;
+ /* set NSSA area defaults */
+ area->no_summary = 0;
+ area->NSSATranslatorRole = OSPF_NSSA_ROLE_CANDIDATE;
+ area->NSSATranslatorState = OSPF_NSSA_TRANSLATE_DISABLED;
+ area->NSSATranslatorStabilityInterval =
+ OSPF_NSSA_TRANS_STABLE_DEFAULT;
ospf_area_type_set(area, OSPF_AREA_DEFAULT);
+ } else {
+ area->NSSATranslatorRole = OSPF_NSSA_ROLE_CANDIDATE;
}
ospf_area_check_free(ospf, area_id);