{
case OSPF_ROUTER_LSA:
/* Originate a new instance and schedule flooding */
- /* It shouldn't be necessary, but anyway */
- ospf_lsa_unlock (&area->router_lsa_self);
- area->router_lsa_self = ospf_lsa_lock (new);
-
+ if (area->router_lsa_self)
+ area->router_lsa_self->data->ls_seqnum = new->data->ls_seqnum;
ospf_router_lsa_timer_add (area);
return;
case OSPF_NETWORK_LSA:
}
#endif /* HAVE_OPAQUE_LSA */
- ospf_lsa_unlock (&oi->network_lsa_self);
- oi->network_lsa_self = ospf_lsa_lock (new);
-
+ if (oi->network_lsa_self)
+ oi->network_lsa_self->data->ls_seqnum = new->data->ls_seqnum;
/* Schedule network-LSA origination. */
ospf_network_lsa_timer_add (oi);
return;
if (rt_recalc)
ospf_spf_calculate_schedule (ospf);
- if (IS_LSA_SELF (new))
+ /* Only install LSA if it is originated/refreshed by us.
+ * If LSA was received by flooding, the RECEIVED flag is set so do
+ * not link the LSA */
+ if (IS_LSA_SELF (new) && !CHECK_FLAG (new->flags, OSPF_LSA_RECEIVED))
{
/* Set router-LSA refresh timer. */
OSPF_TIMER_OFF (area->t_router_lsa_self);