From: Lu Feng Date: Fri, 21 Feb 2014 08:11:15 +0000 (+0000) Subject: ospfd: check the LS-Ack's recentness instead of only comparing the #seq X-Git-Tag: frr-2.0-rc1~1605 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=49d7af115177d05bd66d3115cbacd56a7591ec5e;p=mirror%2Ffrr.git ospfd: check the LS-Ack's recentness instead of only comparing the #seq ISSUE: RTA(DR)-----(BackupDR)RTB RTA advertises a new LSA to RTB, and then flushes the LSA (with setting the age of the LSA to MaxAge) within 1 second. Then the LSA is deleted from RTA, while it still exists on RTB with non-MaxAge and can not be flushed any more. FIX: The reason can be explained in below: a) RTA -- new LSA, #seq=1 --> RTB (RTB will send the delayed Ack in 1s) b) RTA -- MaxAge LSA, #seq=1 --> RTB (RTB discards it for the MIN_LS_ARRIVAL) c) RTA <-- Ack for the new LSA, #seq=1 -- RTB (RTA accepts it) In the step c), ospf_ls_ack() compares the #seq of the entry in the LS-Ack with that of local MaxAge LSA. The #seq of the two entries are same. So the Ack is accepted and the LSA is removed from the retransmit-list (while it should not). In RFC2328, section 13.7. Receiving link state acknowledgments: o If the acknowledgment is for the same instance that is <== contained on the list, remove the item from the list and examine the next acknowledgment. Otherwise: where "same instance" does not mean the same #seq. We must call ospf_lsa_more_recent() to check whether the two instances are same. Signed-off-by: Feng Lu Signed-off-by: Christian Franke Signed-off-by: David Lamparter --- diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c index ab68bf0b7c..cce56fc625 100644 --- a/ospfd/ospf_packet.c +++ b/ospfd/ospf_packet.c @@ -2120,7 +2120,7 @@ ospf_ls_ack (struct ip *iph, struct ospf_header *ospfh, lsr = ospf_ls_retransmit_lookup (nbr, lsa); - if (lsr != NULL && lsr->data->ls_seqnum == lsa->data->ls_seqnum) + if (lsr != NULL && ospf_lsa_more_recent (lsr, lsa) == 0) { #ifdef HAVE_OPAQUE_LSA if (IS_OPAQUE_LSA (lsr->data->type))