diff options
author | Joakim Tjernlund <Joakim.Tjernlund@transmode.se> | 2009-11-19 15:27:30 +0100 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2015-07-29 21:40:32 +0100 |
commit | 94266fa822baf9b9c9e10ac03ccec8ccf3ce0c98 (patch) | |
tree | 61cc2746b57155d6ba932aa6bdde44a40cb8d4e8 /ospfd/ospfd.c | |
parent | 7f56743f7d4b3dcdae329de2de2aba820368c3d9 (diff) | |
download | quagga-94266fa822baf9b9c9e10ac03ccec8ccf3ce0c98.tar.bz2 quagga-94266fa822baf9b9c9e10ac03ccec8ccf3ce0c98.tar.xz |
ospfd: Self nbrs needs to be rebuilt when router ID changes.
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.
Diffstat (limited to 'ospfd/ospfd.c')
-rw-r--r-- | ospfd/ospfd.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index c55bdaeb..4062d645 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -112,8 +112,15 @@ ospf_router_id_update (struct ospf *ospf) if (!IPV4_ADDR_SAME (&router_id_old, &router_id)) { 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) |