aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-08-28 00:27:06 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-29 23:41:11 -0400
commit202863fe4c7a5b0b9a3d3a00d207691635b31930 (patch)
treed0217817dc2282297e6e59fe875480e64b92901e /net/sctp
parent662880f4420340aad4f9a62a349c6c9d4faa1a5d (diff)
sctp: Change sctp to implement csum_levels
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> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/input.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index c1b991294516..b6493b3f11a9 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -133,9 +133,13 @@ int sctp_rcv(struct sk_buff *skb)
133 __skb_pull(skb, skb_transport_offset(skb)); 133 __skb_pull(skb, skb_transport_offset(skb));
134 if (skb->len < sizeof(struct sctphdr)) 134 if (skb->len < sizeof(struct sctphdr))
135 goto discard_it; 135 goto discard_it;
136 if (!sctp_checksum_disable && !skb_csum_unnecessary(skb) && 136
137 sctp_rcv_checksum(net, skb) < 0) 137 skb->csum_valid = 0; /* Previous value not applicable */
138 if (skb_csum_unnecessary(skb))
139 __skb_decr_checksum_unnecessary(skb);
140 else if (!sctp_checksum_disable && sctp_rcv_checksum(net, skb) < 0)
138 goto discard_it; 141 goto discard_it;
142 skb->csum_valid = 1;
139 143
140 skb_pull(skb, sizeof(struct sctphdr)); 144 skb_pull(skb, sizeof(struct sctphdr));
141 145