From ac58e143f7278d5faaad7a8672e48328b03cffa5 Mon Sep 17 00:00:00 2001 From: Dinesh Dutt Date: Sat, 24 Aug 2013 07:54:24 +0000 Subject: [PATCH] ospf6d: remove older version of LSA from neigbor retx list before prematurely aging it. See comment in code for very detailed issue and fix. Signed-off-by: Dinesh G Dutt Reviewed-by: Scott Feldman Signed-off-by: David Lamparter --- ospf6d/ospf6_lsa.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 7dbd303f6b..1839880043 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -258,6 +258,29 @@ ospf6_lsa_premature_aging (struct ospf6_lsa *lsa) THREAD_OFF (lsa->expire); THREAD_OFF (lsa->refresh); + /* + * We clear the LSA from the neighbor retx lists now because it + * will not get deleted later. Essentially, changing the age to + * MaxAge will prevent this LSA from being matched with its + * existing entries in the retx list thereby causing those entries + * to be silently replaced with its MaxAged version, but with ever + * increasing retx count causing this LSA to remain forever and + * for the MaxAge remover thread to be called forever too. + * + * The reason the previous entry silently disappears is that when + * entry is added to a neighbor's retx list, it replaces the existing + * entry. But since the ospf6_lsdb_add() routine is generic and not aware + * of the special semantics of retx count, the retx count is not + * decremented when its replaced. Attempting to add the incr and decr + * retx count routines as the hook_add and hook_remove for the retx lists + * have a problem because the hook_remove routine is called for MaxAge + * entries (as will be the case in a traditional LSDB, unlike in this case + * where an LSDB is used as an efficient tree structure to store all kinds + * of data) that are added instead of calling the hook_add routine. + */ + + ospf6_flood_clear (lsa); + lsa->header->age = htons (OSPF_LSA_MAXAGE); thread_execute (master, ospf6_lsa_expire, lsa, 0); } -- 2.39.5