metag: checksum.h: fix carry in csum_tcpudp_nofold
authorJames Hogan <james.hogan@imgtec.com>
Mon, 8 Jul 2013 11:21:47 +0000 (12:21 +0100)
committerJames Hogan <james.hogan@imgtec.com>
Tue, 9 Jul 2013 10:09:17 +0000 (11:09 +0100)
commitd903bca9bc542bd6d60019f9f761be15ad79c956
tree510a51eccad4bf34a01cad162179817a0d793af1
parent8bb495e3f02401ee6f76d1b1d77f3ac9f079e376
metag: checksum.h: fix carry in csum_tcpudp_nofold

In csum_tcpudp_nofold, add 1 if the carry bit is set after adding the
destination IP address (32 bits) to the checksum (16 bits).

The lack of carry handling for this particular addition meant that a
destination address of *.*.255.255 (e.g. certain broadcasts) sometimes
resulted in an incorrect checksum. This bug has been present in the Meta
port since the code was written in the 2.4 days.

Reported-by: Marcin Nowakowski <Marcin.Nowakowski@pure.com>
Signed-off-by: James Hogan <james.hogan@imgtec.com>
arch/metag/include/asm/checksum.h