summaryrefslogtreecommitdiffstats
path: root/proto
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-05-10 17:04:21 +0200
committerOndrej Filip <feela@network.cz>2000-05-10 17:04:21 +0200
commit13741548a6a75479577ea991bad1e38a4fba6320 (patch)
treef150f5dcf6fd298d510a3456ab4c814c1e68ee09 /proto
parenta9c41c854802d1a8d44e666548423589022111c8 (diff)
downloadbird-13741548a6a75479577ea991bad1e38a4fba6320.tar
bird-13741548a6a75479577ea991bad1e38a4fba6320.zip
Some better lsa checking added.
Diffstat (limited to 'proto')
-rw-r--r--proto/ospf/lsupd.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c
index 64d7dac..1bae1bd 100644
--- a/proto/ospf/lsupd.c
+++ b/proto/ospf/lsupd.c
@@ -251,6 +251,16 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
{
struct ospf_lsa_header lsatmp;
struct top_hash_entry *lsadb;
+ u16 lenn;
+
+ lenn=ntohs(lsa->length);
+
+ if((lenn<=sizeof(struct ospf_lsa_header))||(lenn!=(4*(lenn/4))))
+ {
+ log("Received LSA with bad length\n");
+ ospf_neigh_sm(n,INM_BADLSREQ);
+ break;
+ }
/* pg 143 (1) */
if(lsa->checksum!=lsasum_check(lsa,NULL,po))
{