Wireshark-bugs: [Wireshark-bugs] [Bug 3112] CDP Checksum Calculation Incorrect
Date: Mon, 22 Dec 2008 02:43:53 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3112





--- Comment #4 from Jaap Keuter <jaap.keuter@xxxxxxxxx>  2008-12-22 02:43:51 PDT ---
Created an attachment (id=2592)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=2592)
module test for internet checksum

I have created a module test from in_cksum in the Wireshark source tree, and
your two test functions (WS CDP and CDP). It feeds it several test cases of
even and odd length datasets, starting at even and odd addresses. These are my
results on
Linux Debian 2.6.26-1-686 #1 SMP Mon Dec 15 18:15:07 UTC 2008 i686 GNU/Linux

$ ./cksumtest

test 0 data: 0xbfe29bb0 length: 2       fe 00
in_cksum         65281
WS CDP checksum  65281
CDP checksum     65281

test 1 data: 0xbfe29ba0 length: 2       00 fe
in_cksum         511
WS CDP checksum  511
CDP checksum     511

test 2 data: 0xbfe29b90 length: 3       00 fe 00
in_cksum         511
WS CDP checksum  511
CDP checksum     511

test 3 data: 0xbfe29b80 length: 3       00 00 fe
in_cksum         65281
WS CDP checksum  65281
CDP checksum     511

test 4 data: 0xbfe29b70 length: 4       00 00 fe 00
in_cksum         65281
WS CDP checksum  65281
CDP checksum     65281

test 5 data: 0xbfe29b60 length: 4       00 00 00 fe
in_cksum         511
WS CDP checksum  511
CDP checksum     511

test 6 data: 0xbfe29bb1 length: 1       00
in_cksum         65535
WS CDP checksum  65535
CDP checksum     65535

test 7 data: 0xbfe29ba1 length: 1       fe
in_cksum         65281
WS CDP checksum  65281
CDP checksum     511

test 8 data: 0xbfe29b91 length: 2       fe 00
in_cksum         65281
WS CDP checksum  65281
CDP checksum     65281

test 9 data: 0xbfe29b81 length: 2       00 fe
in_cksum         511
WS CDP checksum  511
CDP checksum     511

test 10 data: 0xbfe29b71 length: 3      00 fe 00
in_cksum         511
WS CDP checksum  511
CDP checksum     511

test 11 data: 0xbfe29b61 length: 3      00 00 fe
in_cksum         65281
WS CDP checksum  65281
CDP checksum     511


-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.