aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-06-10 21:54:19 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-11 18:46:13 -0400
commit7e3cead5172927732f51fde77fef6f521e22f209 (patch)
tree7b7cad61aa68ba302c395b9a1ea3dafb69881d0d /net/sunrpc
parent5d0c2b95bc57cf8fdc0e7b3e9d7e751eb65ad052 (diff)
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 'net/sunrpc')
-rw-r--r--net/sunrpc/socklib.c3
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)
173 return -1; 173 return -1;
174 if (csum_fold(desc.csum)) 174 if (csum_fold(desc.csum))
175 return -1; 175 return -1;
176 if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE)) 176 if (unlikely(skb->ip_summed == CHECKSUM_COMPLETE) &&
177 !skb->csum_complete_sw)
177 netdev_rx_csum_fault(skb->dev); 178 netdev_rx_csum_fault(skb->dev);
178 return 0; 179 return 0;
179no_checksum: 180no_checksum: