Hi Feng I remember this one, I sent a patch long time ago which we even discussed :) See http://patchwork.quagga.net/patch/537/
Yours is a bit different though: 1) at least PtoP links needs the same as virtual links. W.r.t to your comment on my patch, do you really want to keep DR/BDR info when RouterID has changed? Can DR/BDR may change as a result of changing RouterID? 2) You have an extra oi->nbr_self = ospf_nbr_new (oi), is that needed? Jocke On Thu, 2015-01-08 at 10:39 +0800, Feng Lu wrote: > The self-neighbor on virtual-liks must be rebuilt > because the neighbor index, which is the router-id, > is changed. > > Signed-off-by: Feng Lu <[email protected]> > --- > ospfd/ospfd.c | 17 +++++++++++++++-- > 1 files changed, 15 insertions(+), 2 deletions(-) > > diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c > index c55bdae..5993bc0 100644 > --- a/ospfd/ospfd.c > +++ b/ospfd/ospfd.c > @@ -112,8 +112,21 @@ 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; > + { > + /* Update self-neighbor's router_id. */ > + if (oi->type == OSPF_IFTYPE_VIRTUALLINK) > + { > + /* The pseudo neighbor must be reset for virtual-links, > + * because the neighbor index, which is the router-id, > + * is changed. > + */ > + ospf_nbr_delete (oi->nbr_self); > + oi->nbr_self = ospf_nbr_new (oi); > + ospf_nbr_add_self (oi); > + } > + else > + oi->nbr_self->router_id = router_id; > + } > > /* If AS-external-LSA is queued, then flush those LSAs. */ > if (router_id_old.s_addr == 0 && ospf->external_origin) _______________________________________________ Quagga-dev mailing list [email protected] https://lists.quagga.net/mailman/listinfo/quagga-dev
