diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2015-05-01 14:40:56 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2015-05-01 14:40:56 +0200 |
commit | 77edab640925e8d1131f0d00b41de055129ff99f (patch) | |
tree | f05040c396f2683f52ebff7adf9575990f219679 /proto/ospf/topology.c | |
parent | 30d09eb96e8d46143d04285016a137d71a87c416 (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/topology.c')
-rw-r--r-- | proto/ospf/topology.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/proto/ospf/topology.c b/proto/ospf/topology.c index 0613d34d..8119cfa6 100644 --- a/proto/ospf/topology.c +++ b/proto/ospf/topology.c @@ -129,7 +129,7 @@ ospf_advance_lsa(struct ospf_proto *p, struct top_hash_entry *en, struct ospf_ls en->lsa.age = 0; en->init_age = 0; en->inst_time = now; - lsasum_calculate(&en->lsa, en->lsa_body); + lsa_generate_checksum(&en->lsa, en->lsa_body); OSPF_TRACE(D_EVENTS, "Advancing LSA: Type: %04x, Id: %R, Rt: %R, Seq: %08x", en->lsa_type, en->lsa.id, en->lsa.rt, en->lsa.sn); @@ -238,7 +238,7 @@ ospf_do_originate_lsa(struct ospf_proto *p, struct top_hash_entry *en, void *lsa en->lsa.age = 0; en->init_age = 0; en->inst_time = now; - lsasum_calculate(&en->lsa, en->lsa_body); + lsa_generate_checksum(&en->lsa, en->lsa_body); OSPF_TRACE(D_EVENTS, "Originating LSA: Type: %04x, Id: %R, Rt: %R, Seq: %08x", en->lsa_type, en->lsa.id, en->lsa.rt, en->lsa.sn); @@ -382,7 +382,7 @@ ospf_refresh_lsa(struct ospf_proto *p, struct top_hash_entry *en) en->lsa.age = 0; en->init_age = 0; en->inst_time = now; - lsasum_calculate(&en->lsa, en->lsa_body); + lsa_generate_checksum(&en->lsa, en->lsa_body); ospf_flood_lsa(p, en, NULL); } |