summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2021-06-19 12:21:26 -0400
committerGitHub <noreply@github.com>2021-06-19 12:21:26 -0400
commitcd551a0fd5430791ce4e650ccca9b312f02b9701 (patch)
tree03deb3f0baad3ac3cdc427269c7f8308f80f61f7
parent457d4ee3295c82cdf70228fb2a1c5d8e4bfa201f (diff)
parentc5467a12ea002f4fbedf179e826445d9e3dbd4b8 (diff)
Merge pull request #8841 from volta-networks/fix_ospf6_bad_seqnum
ospf6: Drop LSA with bad seqnumber
-rw-r--r--ospf6d/ospf6_flood.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ospf6d/ospf6_flood.c b/ospf6d/ospf6_flood.c
index bb871e255d..05b43189e9 100644
--- a/ospf6d/ospf6_flood.c
+++ b/ospf6d/ospf6_flood.c
@@ -811,6 +811,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);