]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: fix NSSA translator
authorckishimo <carles.kishimoto@gmail.com>
Thu, 19 Nov 2020 07:23:14 +0000 (23:23 -0800)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 27 Nov 2020 14:46:50 +0000 (17:46 +0300)
Having 2 ABR in NSSA area where R3 is the elected translator

R3# show ip ospf
  We are an ABR and the NSSA Elected Translator.
R2# show ip ospf
  We are an ABR, but not the NSSA Elected Translator.

When R3 loses the Border condition by shutting down the interface
to the backbone, we end up with no translator in the NSSA area. It
is expected R2 to take over the translator role

R3# sh ip ospf
  It is not ABR, therefore not Translator.
R2# show ip ospf
   We are an ABR, but not the NSSA Elected Translator.

This PR forces the ABR to reevaluate the translator condition, so
R2 becomes the elected Translator

Signed-off-by: ckishimo <carles.kishimoto@gmail.com>
ospfd/ospf_abr.c
ospfd/ospf_abr.h
ospfd/ospf_spf.c

index c59e19bb16909056669b0f00f757f15f01d8ea56..3f89ab038207f4a7e3548be0b6b0601044c93ac4 100644 (file)
@@ -377,7 +377,7 @@ static int ospf_abr_nssa_am_elected(struct ospf_area *area)
 /* Check NSSA ABR status
  * assumes there are nssa areas
  */
-static void ospf_abr_nssa_check_status(struct ospf *ospf)
+void ospf_abr_nssa_check_status(struct ospf *ospf)
 {
        struct ospf_area *area;
        struct listnode *lnode, *nnode;
index b3007622c4e1b8f869c179ae786785fd3a3c8bc3..e15f4a6bf7b7b0f76f981e02b57b74ebffe1b0df 100644 (file)
@@ -83,4 +83,5 @@ extern void ospf_schedule_abr_task(struct ospf *);
 
 extern void ospf_abr_announce_network_to_area(struct prefix_ipv4 *, uint32_t,
                                              struct ospf_area *);
+extern void ospf_abr_nssa_check_status(struct ospf *ospf);
 #endif /* _ZEBRA_OSPF_ABR_H */
index f5e393a13c0da1b91bff582b06b03b5800cbfbe2..4fc9392635e4a7376753197afcba5c740e579ab8 100644 (file)
@@ -1431,8 +1431,11 @@ static int ospf_spf_calculate_schedule_worker(struct thread *thread)
 
        /* ABRs may require additional changes, see RFC 2328 16.7. */
        monotime(&start_time);
-       if (IS_OSPF_ABR(ospf))
+       if (IS_OSPF_ABR(ospf)) {
+               if (ospf->anyNSSA)
+                       ospf_abr_nssa_check_status(ospf);
                ospf_abr_task(ospf);
+       }
        abr_time = monotime_since(&start_time, NULL);
 
        /* Schedule Segment Routing update */