]> git.proxmox.com Git - mirror_frr.git/blobdiff - ospfd/ospf_neighbor.c
Merge pull request #12798 from donaldsharp/rib_match_multicast
[mirror_frr.git] / ospfd / ospf_neighbor.c
index a1b35b2fcd2bd912fc99fc16c3ef4d681373505f..8338c430772f2bec8ea248afd8501799faa7b621 100644 (file)
@@ -1,22 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
 /*
  * OSPF Neighbor functions.
  * Copyright (C) 1999, 2000 Toshiaki Takada
- *
- * This file is part of GNU Zebra.
- *
- * GNU Zebra 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, or (at your
- * option) any later version.
- *
- * GNU Zebra 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>
@@ -44,7 +29,7 @@
 #include "ospfd/ospf_flood.h"
 #include "ospfd/ospf_dump.h"
 #include "ospfd/ospf_bfd.h"
-#include "ospfd/ospf_gr_helper.h"
+#include "ospfd/ospf_gr.h"
 
 /* Fill in the the 'key' as appropriate to retrieve the entry for nbr
  * from the ospf_interface's nbrs table. Indexed by interface address
@@ -140,17 +125,17 @@ void ospf_nbr_free(struct ospf_neighbor *nbr)
        }
 
        /* Cancel all timers. */
-       OSPF_NSM_TIMER_OFF(nbr->t_inactivity);
-       OSPF_NSM_TIMER_OFF(nbr->t_db_desc);
-       OSPF_NSM_TIMER_OFF(nbr->t_ls_req);
-       OSPF_NSM_TIMER_OFF(nbr->t_ls_upd);
+       THREAD_OFF(nbr->t_inactivity);
+       THREAD_OFF(nbr->t_db_desc);
+       THREAD_OFF(nbr->t_ls_req);
+       THREAD_OFF(nbr->t_ls_upd);
 
        /* Cancel all events. */ /* Thread lookup cost would be negligible. */
        thread_cancel_event(master, nbr);
 
        bfd_sess_free(&nbr->bfd_session);
 
-       OSPF_NSM_TIMER_OFF(nbr->gr_helper_info.t_grace_timer);
+       THREAD_OFF(nbr->gr_helper_info.t_grace_timer);
 
        nbr->oi = NULL;
        XFREE(MTYPE_OSPF_NEIGHBOR, nbr);
@@ -382,10 +367,17 @@ void ospf_renegotiate_optional_capabilities(struct ospf *top)
        struct route_table *nbrs;
        struct route_node *rn;
        struct ospf_neighbor *nbr;
+       uint8_t shutdown_save = top->inst_shutdown;
 
        /* At first, flush self-originated LSAs from routing domain. */
        ospf_flush_self_originated_lsas_now(top);
 
+       /* ospf_flush_self_originated_lsas_now is primarily intended for shut
+        * down scenarios. Reset the inst_shutdown flag that it sets. We are
+        * just changing configuration, and the flag can change the scheduling
+        * of when maxage LSAs are sent. */
+       top->inst_shutdown = shutdown_save;
+
        /* Revert all neighbor status to ExStart. */
        for (ALL_LIST_ELEMENTS_RO(top->oiflist, node, oi)) {
                if ((nbrs = oi->nbrs) == NULL)
@@ -407,6 +399,9 @@ void ospf_renegotiate_optional_capabilities(struct ospf *top)
                }
        }
 
+       /* Refresh/Re-originate external LSAs (Type-7 and Type-5).*/
+       ospf_external_lsa_rid_change(top);
+
        return;
 }
 
@@ -446,7 +441,7 @@ static struct ospf_neighbor *ospf_nbr_add(struct ospf_interface *oi,
                                nbr->nbr_nbma = nbr_nbma;
 
                                if (nbr_nbma->t_poll)
-                                       OSPF_POLL_TIMER_OFF(nbr_nbma->t_poll);
+                                       THREAD_OFF(nbr_nbma->t_poll);
 
                                nbr->state_change = nbr_nbma->state_change + 1;
                        }