Fix from Matt Thomas to fix problem where packets like
0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x01 would be checksummed incorrectly: rather than adding two 32-bit quantities together to sum a quadword (which was losing a carry bit), add as four 16-bit quantities.
This commit is contained in:
parent
a6539cd434
commit
ea82d613ab
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: in_cksum.c,v 1.2 1996/05/19 21:41:00 cgd Exp $ */
|
||||
/* $NetBSD: in_cksum.c,v 1.3 1996/05/30 23:08:36 cgd Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1988, 1992, 1993
|
||||
|
@ -54,7 +54,7 @@
|
|||
#define REDUCE32 \
|
||||
{ \
|
||||
q_util.q = sum; \
|
||||
sum = q_util.l[0] + q_util.l[1]; \
|
||||
sum = q_util.s[0] + q_util.s[1] + q_util.s[2] + q_util.s[3]; \
|
||||
}
|
||||
#define REDUCE16 \
|
||||
{ \
|
||||
|
|
Loading…
Reference in New Issue