]> git.hungrycats.org Git - linux/commitdiff
[IPX]: Fix checksum computation.
authorDavid S. Miller <davem@nuts.ninka.net>
Thu, 30 Oct 2003 11:43:04 +0000 (03:43 -0800)
committerDavid S. Miller <davem@nuts.ninka.net>
Thu, 30 Oct 2003 11:43:04 +0000 (03:43 -0800)
net/appletalk/ddp.c

index 760eb26db9f5d778f87d12103b740b09199e7e5c..48497a95ff654ae9ef2d594f7ab7caaf038633fe 100644 (file)
@@ -937,9 +937,13 @@ static unsigned long atalk_sum_partial(const unsigned char *data,
 {
        /* This ought to be unwrapped neatly. I'll trust gcc for now */
        while (len--) {
-               sum += *data++;
+               sum += *data;
                sum <<= 1;
-               sum = ((sum >> 16) + sum) & 0xFFFF;
+               if (sum & 0x10000) {
+                       sum++;
+                       sum &= 0xffff;
+               }
+               data++;
        }
        return sum;
 }