]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: Set CHECKSUM_UNNECESSARY in tcp_init_nondata_skb
authorDavid S. Miller <davem@davemloft.net>
Thu, 8 Apr 2010 18:32:30 +0000 (11:32 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 11 Apr 2010 22:29:13 +0000 (15:29 -0700)
commit19c8af2f8a58716b6aca821ed56ed909f93be3eb
treecc1e72e6ff4ccd5bb18e544d39691cc0a2e9a599
parenta1c5cadd504f1bd33c5d2e7f752912ad86196ceb
tcp: Set CHECKSUM_UNNECESSARY in tcp_init_nondata_skb

Back in commit 0d064e4c75c70a510af78562b9e36796035246e5
("loopback: Drop obsolete ip_summed setting") we stopped
setting CHECKSUM_UNNECESSARY in the loopback xmit.

This is because such a setting was a lie since it implies that the
checksum field of the packet is properly filled in.

Instead what happens normally is that CHECKSUM_PARTIAL is set and
skb->csum is calculated as needed.

But this was only happening for TCP data packets (via the
skb->ip_summed assignment done in tcp_sendmsg()).  It doesn't
happen for non-data packets like ACKs etc.

Fix this by setting skb->ip_summed in the common non-data packet
constructor.  It already is setting skb->csum to zero.

But this reminds us that we still have things like ip_output.c's
ip_dev_loopback_xmit() which sets skb->ip_summed to the value
CHECKSUM_UNNECESSARY, which Herbert's patch teaches us is not
valid.  So we'll have to address that at some point too.

Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c