]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospf6d/ospf6_gr.c
Merge pull request #13024 from opensourcerouting/fix/bgpd_prefix-list_changes_not_aff...
[mirror_frr.git] / ospf6d / ospf6_gr.c
index d7de66c6631f6d7ea5a652c2b3b10a4b90118eba..847531361eaaa9cc9fb1f7e998108eab633ccccc 100644 (file)
@@ -1,21 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * This is an implementation of RFC 5187 Graceful Restart.
  *
  * Copyright 2021 NetDEF (c), All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; see the file COPYING; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 #include <zebra.h>
@@ -42,9 +29,7 @@
 #include "ospf6d/ospf6_intra.h"
 #include "ospf6d/ospf6_spf.h"
 #include "ospf6d/ospf6_gr.h"
-#ifndef VTYSH_EXTRACT_PL
 #include "ospf6d/ospf6_gr_clippy.c"
-#endif
 
 static void ospf6_gr_nvm_delete(struct ospf6 *ospf6);
 
@@ -142,6 +127,7 @@ static void ospf6_gr_restart_exit(struct ospf6 *ospf6, const char *reason)
 {
        struct ospf6_area *area;
        struct listnode *onode, *anode;
+       struct ospf6_route *route;
 
        if (IS_DEBUG_OSPF6_GR)
                zlog_debug("GR: exiting graceful restart: %s", reason);
@@ -163,8 +149,16 @@ static void ospf6_gr_restart_exit(struct ospf6 *ospf6, const char *reason)
                 */
                OSPF6_ROUTER_LSA_EXECUTE(area);
 
+               /*
+                * Force reorigination of intra-area-prefix-LSAs to handle
+                * areas without any full adjacency.
+                */
+               OSPF6_INTRA_PREFIX_LSA_SCHEDULE_STUB(area);
+
                for (ALL_LIST_ELEMENTS_RO(area->if_list, anode, oi)) {
-                       OSPF6_LINK_LSA_EXECUTE(oi);
+                       /* Reoriginate Link-LSA. */
+                       if (oi->type != OSPF_IFTYPE_VIRTUALLINK)
+                               OSPF6_LINK_LSA_EXECUTE(oi);
 
                        /*
                         * 2) The router should reoriginate network-LSAs on all
@@ -175,6 +169,16 @@ static void ospf6_gr_restart_exit(struct ospf6 *ospf6, const char *reason)
                }
        }
 
+       /*
+        * While all self-originated NSSA and AS-external LSAs were already
+        * learned from the helping neighbors, we need to reoriginate them in
+        * order to ensure they will be refreshed periodically.
+        */
+       for (route = ospf6_route_head(ospf6->external_table); route;
+            route = ospf6_route_next(route))
+               ospf6_handle_external_lsa_origination(ospf6, route,
+                                                     &route->prefix);
+
        /*
         * 3) The router reruns its OSPF routing calculations, this time
         *    installing the results into the system forwarding table, and