diff options
author | Tom Herbert <therbert@google.com> | 2014-06-11 03:54:19 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-12 00:46:13 +0200 |
commit | 7e3cead5172927732f51fde77fef6f521e22f209 (patch) | |
tree | 7b7cad61aa68ba302c395b9a1ea3dafb69881d0d /net/sunrpc/socklib.c | |
parent | net: Preserve CHECKSUM_COMPLETE at validation (diff) | |
download | linux-7e3cead5172927732f51fde77fef6f521e22f209.tar.xz linux-7e3cead5172927732f51fde77fef6f521e22f209.zip |
net: Save software checksum complete
In skb_checksum complete, if we need to compute the checksum for the
packet (via skb_checksum) save the result as CHECKSUM_COMPLETE.
Subsequent checksum verification can use this.
Also, added csum_complete_sw flag to distinguish between software and
hardware generated checksum complete, we should always be able to trust
the software computation.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to '')
-rw-r--r-- | net/sunrpc/socklib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sunrpc/socklib.c b/net/sunrpc/socklib.c index 0a648c502fc3..2df87f78e518 100644 --- a/net/sunrpc/socklib.c +++ b/net/sunrpc/socklib.c @@ -173,7 +173,8 @@ int csum_partial_copy_to_xdr(struct xdr_buf *xdr, struct sk_buff *skb) return -1; if (csum_fold(desc.csum)) return -1; - if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE)) + if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE) && + !skb->csum_complete_sw) netdev_rx_csum_fault(skb->dev); return 0; no_checksum: |