From 30d09eb96e8d46143d04285016a137d71a87c416 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 28 Apr 2015 13:45:44 +0200 Subject: 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. --- proto/ospf/lsalib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'proto/ospf/lsalib.h') 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 -- cgit v1.2.3