[dev] bug fix: ospf6d self orig MaxAge LSA

Yasuhiro Ohara yasu at nttv6.jp
Wed Dec 4 06:34:12 EST 2019


Today I fixed a bug in ospf6d.
The bug seems to be introduced in the following commit.

commit 76249532faadfb429f46dd94cf6bbc61d78b3f26
Date:   Fri Jan 26 14:53:43 2018 -0800

    ospf6d: Handle Premature Aging of LSAs

When ospf6d is restarting, self originated MaxAged LSAs
may be floating around in the network, and the rebooting ospf6d
is likely to receive them from the neighbor, probably with the
higher LS-Seq-Num (which is more recent).
The code introduced by the above commit in ospf6_flood.c:
@@ -806,6 +818,17 @@
was removing the more-recent self-originated MaxAged LSAs
immediately in the receiving process of the LSA, prevent the
LSAs from being installed in the local LSDB.
The just rebooted ospf6d will have the lower LS-Seq-Num, so
it cannot refresh the higher LS-Seq-Num version of the old LSA.
So the ospf6d essentially couldn't advertise any information
when the situation occured.

The bug was significant: the LSAs that can't be updated
in my network included the Router-LSA and the Intra-Area-Prefix-LSA,
so the address in the loopback I/F was not advertised
and the BGP session cannot be established at all.
At some point, the MaxAged LSAs floating in the
network may vanish (I don't know the reason why yet),
and sometimes the problem doesn't occur.

Commenting out the code by #if 0 immediately solved the problem:
the self-originated MaxAged LSAs are installed in the local LSDB
once, and then ospf6d refreshes it with the updated contents,
and then floods. 

I will make a pull-request later.

~/frr/ospf6d# git diff
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c
index 0828c2beb..67172dd4a 100644
--- a/ospf6d/ospf6_flood.c
+++ b/ospf6d/ospf6_flood.c
@@ -842,6 +842,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
                                zlog_debug("Received is duplicated LSA");
                        SET_FLAG(new->flag, OSPF6_LSA_DUPLICATE);
+#if 0
                if (old->header->adv_router
                            == from->ospf6_if->area->ospf6->router_id
                    && OSPF6_LSA_IS_MAXAGE(new)) {
@@ -854,6 +855,7 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
+#endif /*0*/
        /* if no database copy or received is more recent */

Best regards,

More information about the dev mailing list