diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2015-04-28 13:45:44 +0200 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2015-04-28 13:45:44 +0200 |
commit | 30d09eb96e8d46143d04285016a137d71a87c416 (patch) | |
tree | 778a4a098081b86038b79f5eb127ce1979742754 /proto/ospf/lsalib.h | |
parent | 7069fc9e724134ddd841219f5673cc9b13c58490 (diff) |
OSPF: Fixes validation of LSA checksums
Prior to this patch, BIRD validates the OSPF LSA checksum by calculating
a new checksum and comparing it with the checksum in the header. Due to
the specifics of the Fletcher checksum used in OSPF, this is not
necessarily correct as the checkbytes in the header may be calculated via
a different means and end up with a different value that is nonetheless
still correct.
The documented means of validating the checksum as specified in RFC 905
B.4 is to calculate c0 and c1 from the unchanged contents of the packet,
which must result in a zero value to be considered valid.
Thanks to Chris Boot for the patch.
Diffstat (limited to 'proto/ospf/lsalib.h')
-rw-r--r-- | proto/ospf/lsalib.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/proto/ospf/lsalib.h b/proto/ospf/lsalib.h index d9e1a610..4ad770e8 100644 --- a/proto/ospf/lsalib.h +++ b/proto/ospf/lsalib.h @@ -48,7 +48,7 @@ static inline u32 lsa_get_etype(struct ospf_lsa_header *h, struct ospf_proto *p) int lsa_flooding_allowed(u32 type, u32 domain, struct ospf_iface *ifa); void lsasum_calculate(struct ospf_lsa_header *header, void *body); -u16 lsasum_check(struct ospf_lsa_header *h, void *body); +u16 lsasum_check(struct ospf_lsa_header *h, void *body, int update); #define CMP_NEWER 1 #define CMP_SAME 0 #define CMP_OLDER -1 |