mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-13 05:03:40 +00:00
[ospfd] Fix failure of Fletcher checksum with certain compilers
2006-03-27 Paul Jakma <paul.jakma@sun.com> * ospf_lsa.c: (ospf_lsa_checksum) Add an explicit cast to avoid the ambiguities of ANSI and C99 C with respect to type conversion. Detailed problem report and test case with example data supplied by Dmitry Ivanov <dimss@telecentrs.lv>.
This commit is contained in:
parent
d4ce4f681e
commit
075c2011bb
@ -1,3 +1,10 @@
|
||||
2006-03-27 Paul Jakma <paul.jakma@sun.com>
|
||||
|
||||
* ospf_lsa.c: (ospf_lsa_checksum) Add an explicit cast to avoid
|
||||
the ambiguities of ANSI and C99 C with respect to type
|
||||
conversion. Detailed problem report and test case with
|
||||
example data supplied by Dmitry Ivanov <dimss@telecentrs.lv>.
|
||||
|
||||
2006-03-25 Paul Jakma <paul.jakma@sun.com>
|
||||
|
||||
* ospf_interface.c: (ospf_if_lookup_recv_if) Ignore loopbacks,
|
||||
|
@ -202,7 +202,7 @@ ospf_lsa_checksum (struct lsa_header *lsa)
|
||||
c1 %= 255;
|
||||
}
|
||||
|
||||
x = ((length - LSA_CHECKSUM_OFFSET) * c0 - c1) % 255;
|
||||
x = (((int)length - LSA_CHECKSUM_OFFSET) * c0 - c1) % 255;
|
||||
if (x <= 0)
|
||||
x += 255;
|
||||
y = 510 - c0 - x;
|
||||
|
Loading…
Reference in New Issue
Block a user