]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospfd: Self nbrs needs to be rebuilt when router ID changes.
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>
Thu, 19 Nov 2009 14:27:30 +0000 (15:27 +0100)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Thu, 26 May 2016 15:33:30 +0000 (15:33 +0000)
Some self nbrs are identified by router_id, these needs
to be rebuilt instead of just resetting router ID.
Possibly one could optimize for !(virtual | ptop) links
by doing oi->nbr_self->router_id = router_id instead.

Router ID will change once after startup config has been
read and zebra reports router ID, unless router ID has
been configured in ospf.

(cherry picked from commit 94266fa822baf9b9c9e10ac03ccec8ccf3ce0c98)

ospfd/ospfd.c

index 665091d70bcda291854417d5953655e9afd4138c..b4da7336104d333ef6b577cf309a919698b07707 100644 (file)
@@ -118,8 +118,15 @@ ospf_router_id_update (struct ospf *ospf)
     {
 
       for (ALL_LIST_ELEMENTS_RO (ospf->oiflist, node, oi))
-        /* Update self-neighbor's router_id. */
-        oi->nbr_self->router_id = router_id;
+       {
+         /* Some nbrs are identified by router_id, these needs
+          * to be rebuilt. Possible optimization would be to do
+          * oi->nbr_self->router_id = router_id for
+          * !(virtual | ptop) links
+          */
+         ospf_nbr_delete(oi->nbr_self);
+         ospf_nbr_add_self(oi);
+       }
 
       /* If AS-external-LSA is queued, then flush those LSAs. */
       if (router_id_old.s_addr == 0 && ospf->external_origin)