MIPS: Fix special case in 64 bit IP checksumming.
authorRalf Baechle <ralf@linux-mips.org>
Thu, 26 Jan 2017 01:16:47 +0000 (02:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 20 Jun 2017 12:04:22 +0000 (14:04 +0200)
commit95589a7820c1fbc58882c13c71c182ed4dd82ce0
treec3aa723b78959b7feb891dd0eb7eba9cfb42b634
parentc0c294a36ea7b8f5ade83caf8a43692086318afd
MIPS: Fix special case in 64 bit IP checksumming.

commit 66fd848cadaa6be974a8c780fbeb328f0af4d3bd upstream.

For certain arguments such as saddr = 0xc0a8fd60, daddr = 0xc0a8fda1,
len = 80, proto = 17, sum = 0x7eae049d there will be a carry when
folding the intermediate 64 bit checksum to 32 bit but the code doesn't
add the carry back to the one's complement sum, thus an incorrect result
will be generated.

Reported-by: Mark Zhang <bomb.zhang@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Reviewed-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
arch/mips/include/asm/checksum.h