]> git.baikalelectronics.ru Git - kernel.git/commit
net: Preserve CHECKSUM_COMPLETE at validation
authorTom Herbert <therbert@google.com>
Wed, 11 Jun 2014 01:54:13 +0000 (18:54 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 11 Jun 2014 22:46:12 +0000 (15:46 -0700)
commitda73a7a9a971a55b825987afb6b2775bbc4e2fd2
tree7614df8920d998a75dda7c1530ec6fc4d558d1f4
parent3c197bf4809921f67bfbca2d474c9b8a31be8a4c
net: Preserve CHECKSUM_COMPLETE at validation

Currently when the first checksum in a packet is validated using
CHECKSUM_COMPLETE, ip_summed is overwritten to be CHECKSUM_UNNECESSARY
so that any subsequent checksums in the packet are not correctly
validated.

This patch adds csum_valid flag in sk_buff and uses that to indicate
validated checksum instead of setting CHECKSUM_UNNECESSARY. The bit
is set accordingly in the skb_checksum_validate_* functions. The flag
is checked in skb_checksum_complete, so that validation is communicated
between checksum_init and checksum_complete sequence in TCP and UDP.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/skbuff.h