Fix ptclcsum_one to adjust odd
authorXiao Jia <stfairy@gmail.com>
Wed, 28 Oct 2015 00:36:37 +0000 (17:36 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 3 Nov 2015 17:00:38 +0000 (12:00 -0500)
Signed-off-by: Xiao Jia <stfairy@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/net/ipaux.c

index cf1eeb2..26ad7b8 100644 (file)
@@ -279,8 +279,8 @@ uint16_t ptclcsum_one(struct block *bp, int offset, int len)
                        hisum += ptclbsum(addr, x);
                else
                        losum += ptclbsum(addr, x);
+               odd = (odd + x) & 1;
                len -= x;
-
        }
        losum += hisum >> 8;
        losum += (hisum & 0xff) << 8;