I think I mentioned this in passing but the fletcher checksum impl. is fragile. Try changing "u16 length" to "u32 length" and watch it break for no apparent reason. Jocke
On Mon, Apr 26, 2010 at 11:27:46AM +0200, Joakim Tjernlund wrote:
I think I mentioned this in passing but the fletcher checksum impl. is fragile. Try changing "u16 length" to "u32 length" and watch it break for no apparent reason.
Yes, i noticed that and will fix that. Thanks. -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
On Mon, Apr 26, 2010 at 11:27:46AM +0200, Joakim Tjernlund wrote:
I think I mentioned this in passing but the fletcher checksum impl. is fragile. Try changing "u16 length" to "u32 length" and watch it break for no apparent reason.
Yes, i noticed that and will fix that. Thanks.
You know what the fix is? a (int) type cast like so: x = (int)((length - LSA_CHECKSUM_OFFSET) * c0 - c1) % 255; It is in one of my patches. Jocke
On Tue, Apr 27, 2010 at 04:39:37PM +0200, Joakim Tjernlund wrote:
I think I mentioned this in passing but the fletcher checksum impl. is fragile. Try changing "u16 length" to "u32 length" and watch it break for no apparent reason.
Yes, i noticed that and will fix that. Thanks.
You know what the fix is? a (int) type cast like so: x = (int)((length - LSA_CHECKSUM_OFFSET) * c0 - c1) % 255;
Yes, i noticed that. -- Elen sila lumenn' omentielvo Ondrej 'SanTiago' Zajicek (email: santiago@crfreenet.org) OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net) "To err is human -- to blame it on a computer is even more so."
You know what the fix is? a (int) type cast like so: x = (int)((length - LSA_CHECKSUM_OFFSET) * c0 - c1) % 255;
Yes, i noticed that.
I'm totally not in sync with this thread, but are you sure, that you really want to do a modulo 255 operation and not modulo 256 ( & 0xff ) here?
Peter Lieven <pli@peering.eu> wrote on 2010/04/27 16:48:38:
You know what the fix is? a (int) type cast like so: x = (int)((length - LSA_CHECKSUM_OFFSET) * c0 - c1) % 255;
Yes, i noticed that.
I'm totally not in sync with this thread, but are you sure, that you really want to do a modulo 255 operation and not modulo 256 ( & 0xff ) here?
How does that work with negative numbers?
participants (3)
-
Joakim Tjernlund -
Ondrej Zajicek -
Peter Lieven