summaryrefslogtreecommitdiffstats
path: root/ospfd/ospf_lsa.c
diff options
context:
space:
mode:
authorpaul <paul>2006-03-30 14:34:31 +0000
committerpaul <paul>2006-03-30 14:34:31 +0000
commit81678f96fc066027abf893423671ead16c692ec3 (patch)
tree9fba7ab0cedd76a9f8a48263c1eb52494330673a /ospfd/ospf_lsa.c
parent20c84d6a022b3d0c91bf463b753f61f6dc90862a (diff)
downloadquagga-81678f96fc066027abf893423671ead16c692ec3.tar.bz2
quagga-81678f96fc066027abf893423671ead16c692ec3.tar.xz
[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>.
Diffstat (limited to 'ospfd/ospf_lsa.c')
-rw-r--r--ospfd/ospf_lsa.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c
index 12959f04..faae4376 100644
--- a/ospfd/ospf_lsa.c
+++ b/ospfd/ospf_lsa.c
@@ -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;