summaryrefslogtreecommitdiffstats
path: root/proto/ospf
diff options
context:
space:
mode:
authorOndrej Filip <feela@network.cz>2000-06-05 20:09:15 +0200
committerOndrej Filip <feela@network.cz>2000-06-05 20:09:15 +0200
commitaba5e89f9310bb33c7362b02108e640983ad0819 (patch)
treec40295b7b175743f372f074f7e17baff72bdf2bb /proto/ospf
parent4c5f93d76bd0636407a185c175fe73411ae79a32 (diff)
downloadbird-aba5e89f9310bb33c7362b02108e640983ad0819.tar
bird-aba5e89f9310bb33c7362b02108e640983ad0819.zip
Better checksum checking.
Diffstat (limited to 'proto/ospf')
-rw-r--r--proto/ospf/lsupd.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c
index 2b94b60..8fbef11 100644
--- a/proto/ospf/lsupd.c
+++ b/proto/ospf/lsupd.c
@@ -276,6 +276,7 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
struct top_hash_entry *lsadb;
u16 lenn;
int diff=((u8 *)lsa)-((u8 *)ps);
+ u16 chsum;
if(((diff+sizeof(struct ospf_lsa_header))>=size) ||
((ntohs(lsa->length)+diff)>size))
@@ -290,7 +291,8 @@ ospf_lsupd_rx(struct ospf_lsupd_packet *ps, struct proto *p,
break;
}
/* pg 143 (1) */
- if(lsa->checksum!=lsasum_check(lsa,NULL,po))
+ chsum=lsa->checksum;
+ if(chsum!=lsasum_check(lsa,NULL,po))
{
log("Received bad lsa checksum from %I",n->rid);
continue;