From 730228092ed7d2fbc1ef2f1902de70d5b84cae7b Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 30 Oct 2003 03:43:04 -0800 Subject: [PATCH] [IPX]: Fix checksum computation. --- net/appletalk/ddp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c index 760eb26db9f5d..48497a95ff654 100644 --- a/net/appletalk/ddp.c +++ b/net/appletalk/ddp.c @@ -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; } -- 2.53.0