]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcp: fix wrong checksum calculation on MTU probing
authorDouglas Caetano dos Santos <douglascs@taghos.com.br>
Thu, 22 Sep 2016 18:52:04 +0000 (15:52 -0300)
committerJiri Slaby <jslaby@suse.cz>
Thu, 24 Nov 2016 15:24:02 +0000 (16:24 +0100)
commit511ad85e5eb023f16494d703446f3d7b7f09e879
treebcd9924a7fe63f67199380dc93ac5297c044c736
parent1497fd0e23a1cbf0bfda0af3107d825166d98e3d
tcp: fix wrong checksum calculation on MTU probing

[ Upstream commit 2fe664f1fcf7c4da6891f95708a7a56d3c024354 ]

With TCP MTU probing enabled and offload TX checksumming disabled,
tcp_mtu_probe() calculated the wrong checksum when a fragment being copied
into the probe's SKB had an odd length. This was caused by the direct use
of skb_copy_and_csum_bits() to calculate the checksum, as it pads the
fragment being copied, if needed. When this fragment was not the last, a
subsequent call used the previous checksum without considering this
padding.

The effect was a stale connection in one way, as even retransmissions
wouldn't solve the problem, because the checksum was never recalculated for
the full SKB length.

Signed-off-by: Douglas Caetano dos Santos <douglascs@taghos.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/ipv4/tcp_output.c