]> git.baikalelectronics.ru Git - kernel.git/commit
Merge branch 'ipv4-ipv6-csums'
authorDavid S. Miller <davem@davemloft.net>
Mon, 14 Mar 2016 03:55:14 +0000 (23:55 -0400)
committerDavid S. Miller <davem@davemloft.net>
Mon, 14 Mar 2016 03:55:14 +0000 (23:55 -0400)
commit78bc0d78723b58622ccae5da3c157891646f7e40
tree6cb060f2472662019329028c10af017473a5549e
parenta7453721fdbbfce168f3cfd05994034195aa414c
parentef03f07414d16098a0c4ce36f7fe946e90cee3bc
Merge branch 'ipv4-ipv6-csums'

Alexander Duyck says:

====================
Fix differences between IPv4 and IPv6 TCP/UDP checksum calculation

This patch series is meant to address the differences that exist between
IPv4 and IPv6 in terms of checksum calculation.  Specifically the IPv6
function csum_ipv6_magic treated length as a value that could be greater
than 64K, while csum_tcpudp_magic was truncating the length at 16 bits.
After looking over the code and giving it some thought I decided it would
be best to update the IPv4 function so that it worked the same way the IPv6
one did.  This allows us to get the same results given the same inputs for
both functions.  As a result we can use the same processes to reverse the
calculation in the event we need to do something like remove the length of
the pseudo-header checksum.

I also took the opportunity to standardize things so that the parameters
for these functions all use the correct types.  IPv4 addresses are __be32,
length should always be __u32, and protocol is a __u8.

With this change in place it corrects an issue with UDP tunnels in which we
were getting a checksum that was off by 1 when performing fragmentation on
inner UDP packets.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>