]> git.puffer.fish Git - mirror/frr.git/commitdiff
[ospfd] Fix failure of Fletcher checksum with certain compilers
authorPaul Jakma <paul.jakma@sun.com>
Thu, 30 Mar 2006 14:34:31 +0000 (14:34 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Thu, 30 Mar 2006 14:34:31 +0000 (14:34 +0000)
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>.

ospfd/ChangeLog
ospfd/ospf_lsa.c

index e5aa0660d3253b732941c1a9a42f49b0ca12af17..265c9c7624da3598bdb95b8efeec258e4c6cd55c 100644 (file)
@@ -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,
index 12959f0488e414f4ebcddfc839993cea2ee5b8cf..faae4376d2c66025b7d634564c382f3aeb979ff0 100644 (file)
@@ -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;