From a60eab9e109fd2625dc3f941d7d9be2b6312f593 Mon Sep 17 00:00:00 2001 From: rgirada Date: Tue, 5 Oct 2021 00:52:36 -0700 Subject: [PATCH] ospf6d: ospf6d is crashing upon receiving duplicated Grace LSA. Description: When grace lsa received, DUT is adding the copy of the lsas to all nbrs retransmission list as part of flooding procedure and subsequently incrementing the rmt counter in the original the LSA. This counter is supposed to be decremented when ack is received by nbr and the lsa will be removed from retransmission list. But in our current scenario, Step-1: When GR helper is disabled, if DUT receives the grace lsa it adds the lsa copy to nbrs retransmission list but original LSA will be discarded since GR helper disabled. Step-2: GR helper enabled and DUT receives the grace lsa, as part of flooding process all nbrs have same copy of lsa in their corresponding rmt list which was added in step -1 due to this the corresponding rmt counter in the original lsa is not getting incremented. Step-3: If the same copy of the grace lsa received by DUT, It considers as implicit ack from nbr if the same copy of the lsa exits in its rmt list and subsequently decrement the rmt counter. Since counter is zero (because of step-1 and 2) , it is asserting while decrement. Signed-off-by: Rajesh Girada --- ospf6d/ospf6_flood.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c index 186eac35a5..fa43c37ac7 100644 --- a/ospf6d/ospf6_flood.c +++ b/ospf6d/ospf6_flood.c @@ -1028,15 +1028,8 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from, if (old) ospf6_flood_clear(old); - /* (b) immediately flood and (c) remove from all retrans-list */ - /* Prevent self-originated LSA to be flooded. this is to make - reoriginated instance of the LSA not to be rejected by other - routers - due to MinLSArrival. */ self_originated = (new->header->adv_router == from->ospf6_if->area->ospf6->router_id); - if (!self_originated) - ospf6_flood(from, new); /* Received non-self-originated Grace LSA. */ if (IS_GRACE_LSA(new) && !self_originated) { @@ -1082,6 +1075,14 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from, } } + /* (b) immediately flood and (c) remove from all retrans-list */ + /* Prevent self-originated LSA to be flooded. this is to make + * reoriginated instance of the LSA not to be rejected by other + * routers due to MinLSArrival. + */ + if (!self_originated) + ospf6_flood(from, new); + /* (d), installing lsdb, which may cause routing table calculation (replacing database copy) */ ospf6_install_lsa(new); -- 2.39.5