summaryrefslogtreecommitdiff
path: root/proto/ospf/lsupd.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2015-05-01 14:40:56 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2015-05-01 14:40:56 +0200
commit77edab640925e8d1131f0d00b41de055129ff99f (patch)
treef05040c396f2683f52ebff7adf9575990f219679 /proto/ospf/lsupd.c
parent30d09eb96e8d46143d04285016a137d71a87c416 (diff)
OSPF: Redesign LSA checksumming
New LSA checksumming code separates generic Fletcher-16 and OSPF-specific code and avoids back and forth endianity conversions, making it much more readable and also several times faster.
Diffstat (limited to 'proto/ospf/lsupd.c')
-rw-r--r--proto/ospf/lsupd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c
index 6e7dce26..c6a734ca 100644
--- a/proto/ospf/lsupd.c
+++ b/proto/ospf/lsupd.c
@@ -530,8 +530,8 @@ ospf_receive_lsupd(struct ospf_packet *pkt, struct ospf_iface *ifa,
DBG("Update Type: %04x, Id: %R, Rt: %R, Sn: 0x%08x, Age: %u, Sum: %u\n",
lsa_type, lsa.id, lsa.rt, lsa.sn, lsa.age, lsa.checksum);
- /* RFC 2328 13. (1) - validate LSA checksum */
- if ((lsa_n->checksum == 0) || (lsasum_check(lsa_n, NULL, 0) != 0))
+ /* RFC 2328 13. (1) - verify LSA checksum */
+ if ((lsa_n->checksum == 0) || !lsa_verify_checksum(lsa_n, lsa_len))
SKIP("invalid checksum");
/* RFC 2328 13. (2) */