]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: install Type-7 when NSSA enabled after redistribution
authorAlexander Chernavin <achernavin@netgate.com>
Tue, 25 Aug 2020 09:50:39 +0000 (05:50 -0400)
committerAlexander Chernavin <achernavin@netgate.com>
Thu, 3 Sep 2020 12:12:05 +0000 (08:12 -0400)
If NSSA is enabled before redistribution is configured, Type-7 LSA's
are installed. But if NSSA is enabled after redistribution is
configured, Type-7 LSAs are missing.

With this change, when NSSA is enabled, scan for external LSA's and
if they exist, install Type-7.

Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
ospfd/ospf_abr.c
ospfd/ospf_asbr.c
ospfd/ospf_asbr.h

index 3dbc476172e829f02896ef3a5aeff7234c6de2e5..f6c05049990392fe2658369e35f81f39850dc09c 100644 (file)
@@ -1802,6 +1802,7 @@ static int ospf_abr_task_timer(struct thread *thread)
 
        ospf_abr_task(ospf);
        ospf_abr_nssa_task(ospf); /* if nssa-abr, then scan Type-7 LSDB */
+       ospf_asbr_nssa_redist_task(ospf);
 
        return 0;
 }
index 1480b0e3914bbf6b0efeb4693450e05bb5064801..8fb6402c7e9522c449531c4d305b74ae08f20be1 100644 (file)
@@ -275,6 +275,30 @@ void ospf_asbr_status_update(struct ospf *ospf, uint8_t status)
        ospf_router_lsa_update(ospf);
 }
 
+/* If there's redistribution configured, we need to refresh external
+ * LSAs in order to install Type-7 and flood to all NSSA Areas
+ */
+void ospf_asbr_nssa_redist_task(struct ospf *ospf)
+{
+       int type;
+
+       for (type = 0; type < ZEBRA_ROUTE_MAX; type++) {
+               struct list *red_list;
+               struct listnode *node;
+               struct ospf_redist *red;
+
+               red_list = ospf->redist[type];
+               if (!red_list)
+                       continue;
+
+               for (ALL_LIST_ELEMENTS_RO(red_list, node, red))
+                       ospf_external_lsa_refresh_type(
+                               ospf, type, red->instance, LSA_REFRESH_FORCE);
+       }
+
+       ospf_external_lsa_refresh_default(ospf);
+}
+
 void ospf_redistribute_withdraw(struct ospf *ospf, uint8_t type,
                                unsigned short instance)
 {
index 1bcc32e3d8250f3daac86ba7006df76d4d99ae0d..ede6c479063cf4d4415f10ffd9384102733e4a52 100644 (file)
@@ -72,6 +72,7 @@ extern struct external_info *ospf_external_info_lookup(struct ospf *, uint8_t,
                                                       unsigned short,
                                                       struct prefix_ipv4 *);
 extern void ospf_asbr_status_update(struct ospf *, uint8_t);
+extern void ospf_asbr_nssa_redist_task(struct ospf *ospf);
 
 extern void ospf_redistribute_withdraw(struct ospf *, uint8_t, unsigned short);
 extern void ospf_asbr_check(void);