From aba6351b399c4b65f2e9c3bd9fe96bd4cfe5deb5 Mon Sep 17 00:00:00 2001 From: Martin Buck Date: Tue, 29 Sep 2020 23:07:40 +0200 Subject: [PATCH] ospf6d: Fix flooding of old copies of self-originated LSAs When receiving old copies (e.g. originated before the local ospf6d was restarted) of supposedly self-originated LSAs which we previously tried to flush from the network (by setting them to MaxAge), neither flood them nor add them to our LSDB. Instead, keep the MaxAge version until we actually (re-)originate them. Possible fix for #7030. Testcase in #7168 (tests/topotests/ospf6-dr-no-netlsa-bug7030). Signed-off-by: Martin Buck --- ospf6d/ospf6_flood.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index b144c6804e..56aac0f21f 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -1001,18 +1001,22 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from, * MAXAGEd and not removed.*/ if (OSPF6_LSA_IS_MAXAGE(old) && !OSPF6_LSA_IS_MAXAGE(new)) { - - if (is_debug) - zlog_debug( - "%s: Current copy of LSA %s is MAXAGE, but new has recent Age.", - old->name, __func__); - - ospf6_lsa_purge(old); if (new->header->adv_router - != from->ospf6_if->area->ospf6->router_id) + != from->ospf6_if->area->ospf6->router_id) { + if (is_debug) + zlog_debug( + "%s: Current copy of LSA %s is MAXAGE, but new has recent age, flooding/installing.", + old->name, __PRETTY_FUNCTION__); + ospf6_lsa_purge(old); ospf6_flood(from, new); - - ospf6_install_lsa(new); + ospf6_install_lsa(new); + } else { + if (is_debug) + zlog_debug( + "%s: Current copy of self-originated LSA %s is MAXAGE, but new has recent age, ignoring new.", + old->name, __PRETTY_FUNCTION__); + ospf6_lsa_delete(new); + } return; } -- 2.39.5