Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 202863fe authored by Tom Herbert's avatar Tom Herbert Committed by David S. Miller
Browse files

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: default avatarTom Herbert <therbert@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 662880f4
Loading
Loading
Loading
Loading
+6 −2
Original line number Original line Diff line number Diff line
@@ -133,9 +133,13 @@ int sctp_rcv(struct sk_buff *skb)
	__skb_pull(skb, skb_transport_offset(skb));
	__skb_pull(skb, skb_transport_offset(skb));
	if (skb->len < sizeof(struct sctphdr))
	if (skb->len < sizeof(struct sctphdr))
		goto discard_it;
		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_decr_checksum_unnecessary(skb);
	else if (!sctp_checksum_disable && sctp_rcv_checksum(net, skb) < 0)
		goto discard_it;
		goto discard_it;
	skb->csum_valid = 1;


	skb_pull(skb, sizeof(struct sctphdr));
	skb_pull(skb, sizeof(struct sctphdr));