Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next 3/8] sctp: Change sctp to implement csum_levels
@ 2014-08-26  0:56 Tom Herbert
  0 siblings, 0 replies; only message in thread
From: Tom Herbert @ 2014-08-26  0:56 UTC (permalink / raw)
  To: davem, netdev

CHECKSUM_UNNECESSARY may be applied to the SCTP CRC so we need to
appropriate account for this by decrementing csum_level. This is
done by calling __skb_dec_checksum_unnecessary.

Signed-off-by: Tom Herbert <therbert@google.com>
---
 net/sctp/input.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/net/sctp/input.c b/net/sctp/input.c
index c1b9912..c86b86c 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -133,9 +133,13 @@ int sctp_rcv(struct sk_buff *skb)
 	__skb_pull(skb, skb_transport_offset(skb));
 	if (skb->len < sizeof(struct sctphdr))
 		goto discard_it;
-	if (!sctp_checksum_disable && !skb_csum_unnecessary(skb) &&
-		  sctp_rcv_checksum(net, skb) < 0)
+
+	skb->csum_valid = 0; /* Previous value not applicable */
+	if (skb_csum_unnecessary(skb))
+		__skb_dec_checksum_unnecessary(skb);
+	else if (!sctp_checksum_disable && sctp_rcv_checksum(net, skb) < 0)
 		goto discard_it;
+	skb->csum_valid = 1;
 
 	skb_pull(skb, sizeof(struct sctphdr));
 
-- 
2.1.0.rc2.206.gedb03e5

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-08-26  1:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-26  0:56 [PATCH net-next 3/8] sctp: Change sctp to implement csum_levels Tom Herbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox