]> git.proxmox.com Git - mirror_frr.git/commitdiff
ospfd: catch and report runt LSAs
authorLou Berger <lberger@labn.net>
Fri, 28 Oct 2022 16:06:04 +0000 (16:06 +0000)
committerLou Berger <lberger@labn.net>
Sat, 29 Oct 2022 12:33:23 +0000 (12:33 +0000)
Signed-off-by: Lou Berger <lberger@labn.net>
ospfd/ospf_packet.c

index 466b5fa2a27cd062553eda548682465950b738d9..8c87a568c0bc38d23737447316325ed6803b8596 100644 (file)
@@ -1716,6 +1716,12 @@ static struct list *ospf_ls_upd_list_lsa(struct ospf_neighbor *nbr,
                        break;
                }
 
+               if (length < OSPF_LSA_HEADER_SIZE) {
+                       flog_warn(EC_OSPF_PACKET,
+                                 "Link State Update: LSA length too small.");
+                       break;
+               }
+
                /* Validate the LSA's LS checksum. */
                sum = lsah->checksum;
                if (!ospf_lsa_checksum_valid(lsah)) {