From bd2462425205a681d75e04c94a94bf4cea5da58b Mon Sep 17 00:00:00 2001 From: Joakim Tjernlund Date: Mon, 5 Jan 2009 17:44:46 +0100 Subject: [ospfd] Do not use stale Network/Router LSAs Should a self originated Network/Router LSA with higher LS seq. nr. be received we should flood and install it in the LSDB but we cannot use it for our internal calculations as it is stale. Reorginate an new LSA to replace the stale one as soon as possible. --- ospfd/ospf_flood.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'ospfd/ospf_flood.c') diff --git a/ospfd/ospf_flood.c b/ospfd/ospf_flood.c index 0f485fe3..41661da2 100644 --- a/ospfd/ospf_flood.c +++ b/ospfd/ospf_flood.c @@ -133,10 +133,8 @@ ospf_process_self_originated_lsa (struct ospf *ospf, { 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: @@ -170,9 +168,8 @@ ospf_process_self_originated_lsa (struct ospf *ospf, } #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; -- cgit v1.2.1