]> git.puffer.fish Git - mirror/frr.git/commitdiff
ospf6: Drop LSA with bad seqnumber 9123/head
authorlynne <lynne@voltanet.io>
Fri, 11 Jun 2021 14:38:42 +0000 (10:38 -0400)
committermergify-bot <noreply@mergify.io>
Thu, 22 Jul 2021 22:36:45 +0000 (22:36 +0000)
In RFC 2328 seqnumber 0x80000000 is reserved and not used.   If an LSA
is received with seqnumber the LSA is now dropped and a debug error log
is printed.

Signed-off-by: Lynne Morrison <lynne@voltanet.io>
(cherry picked from commit c5467a12ea002f4fbedf179e826445d9e3dbd4b8)

ospf6d/ospf6_flood.c

index 76e81aab7b853f295c7c7a69d2e43cf0c66bb683..40978e89bda47b0bb6eaa64d3b7cc972886bb581 100644 (file)
@@ -775,6 +775,18 @@ void ospf6_receive_lsa(struct ospf6_neighbor *from,
        ismore_recent = 1;
        assert(from);
 
+       /* if we receive a LSA with invalid seqnum drop it */
+       if (ntohl(lsa_header->seqnum) - 1 == OSPF_MAX_SEQUENCE_NUMBER) {
+               if (IS_OSPF6_DEBUG_EXAMIN_TYPE(lsa_header->type)) {
+                       zlog_debug(
+                               "received lsa [%s Id:%pI4 Adv:%pI4] with invalid seqnum 0x%x, ignore",
+                               ospf6_lstype_name(lsa_header->type),
+                               &lsa_header->id, &lsa_header->adv_router,
+                               ntohl(lsa_header->seqnum));
+               }
+               return;
+       }
+
        /* make lsa structure for received lsa */
        new = ospf6_lsa_create(lsa_header);