From 77edab640925e8d1131f0d00b41de055129ff99f Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 1 May 2015 14:40:56 +0200 Subject: 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. --- proto/ospf/lsupd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'proto/ospf/lsupd.c') 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) */ -- cgit v1.2.3