summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_packet.c
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2022-10-28 18:06:04 +0200
committerLou Berger <lberger@labn.net>2022-10-29 14:33:23 +0200
commit53674eaba6a34f42f322f79449c2ab667884fb82 (patch)
tree40186d76ba6fe3e16de69a469cd5c93b709fceb7 /ospfd/ospf_packet.c
parentospfd: remove assert on zero length LSA - which is permitted by spec (diff)
downloadfrr-53674eaba6a34f42f322f79449c2ab667884fb82.tar.xz
frr-53674eaba6a34f42f322f79449c2ab667884fb82.zip
ospfd: catch and report runt LSAs
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to 'ospfd/ospf_packet.c')
-rw-r--r--ospfd/ospf_packet.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ospfd/ospf_packet.c b/ospfd/ospf_packet.c
index 466b5fa2a..8c87a568c 100644
--- a/ospfd/ospf_packet.c
+++ b/ospfd/ospf_packet.c
@@ -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)) {