diff options
author | Wolfgang Denk <wd@pollux.(none)> | 2005-11-10 19:59:46 (GMT) |
---|---|---|
committer | Wolfgang Denk <wd@pollux.(none)> | 2005-11-10 19:59:46 (GMT) |
commit | 3ada834e30a0742991209140049035c626ccea85 (patch) | |
tree | 3f5a1eb9f1b923884dd4bccd6eb92a3aabc30dff /net/net.c | |
parent | ea339205a94706d8b9170bbd89e8c1373df9a92f (diff) | |
download | u-boot-fsl-qoriq-3ada834e30a0742991209140049035c626ccea85.tar.xz |
Add explanation for CDP checksum algorithm
Diffstat (limited to 'net/net.c')
-rw-r--r-- | net/net.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -829,7 +829,10 @@ static ushort CDP_compute_csum(const uchar *buff, ushort len) } if (len) { leftover = (signed short)(*(const signed char *)buff); - /* * XXX CISCO SUCKS big time! (and blows too) */ + /* CISCO SUCKS big time! (and blows too): + * CDP uses the IP checksum algorithm with a twist; + * for the last byte it *sign* extends and sums. + */ result = (result & 0xffff0000) | ((result + leftover) & 0x0000ffff); } while (result >> 16) |