Commit b9cdb672a7 for frr
commit b9cdb672a7536af86700ea3a4b46a7fd3b5c27e7
Author: Nageswara Soma <nsoma@cisco.com>
Date: Sun Nov 15 21:26:05 2026 -0800
ospf6d: order equal-sequence LSAs by checksum
For equal-sequence instances of the same LSA,
ospf6_lsa_compare() returns 0 when the first checksum
is lower. A received older update therefore takes
the duplicate path instead of sending the newer
database copy back to the neighbor. An older LS Ack
can also incorrectly clear a newer retransmission.
Return 1 to mark the first instance as older, as
required by the comparator's contract and RFC 2328
section 13.1. RFC 5340 section 4.5 retains this
checksum ordering for OSPFv3.
The LSDB reference-output regression
tests/ospf6d/test_lsdb.py::TestLSDB::test_refout
fails without this fix on lower-checksum comparisons.
Signed-off-by: Nageswara Soma <nsoma@cisco.com>
diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c
index 01d79df112..3fe9ac295e 100644
--- a/ospf6d/ospf6_lsa.c
+++ b/ospf6d/ospf6_lsa.c
@@ -440,7 +440,7 @@ int ospf6_lsa_compare(struct ospf6_lsa *a, struct ospf6_lsa *b)
if (cksuma > cksumb)
return -1;
if (cksuma < cksumb)
- return 0;
+ return 1;
/* Update Age */
agea = ospf6_lsa_age_current(a);