summaryrefslogtreecommitdiffstats
path: root/net/sctp/input.c
diff options
context:
space:
mode:
authorJoe Stringer <joe@wand.net.nz>2013-07-25 03:52:05 +0200
committerDavid S. Miller <davem@davemloft.net>2013-07-28 05:07:15 +0200
commit024ec3deac33ddbd81f3c887506f132b24ea21a7 (patch)
tree32e21519a6180435415dc89628929d0e6ed56ecf /net/sctp/input.c
parentvirtio-net: put virtio net header inline with data (diff)
downloadlinux-024ec3deac33ddbd81f3c887506f132b24ea21a7.tar.xz
linux-024ec3deac33ddbd81f3c887506f132b24ea21a7.zip
net/sctp: Refactor SCTP skb checksum computation
This patch consolidates the SCTP checksum calculation code from various places to a single new function, sctp_compute_cksum(skb, offset). Signed-off-by: Joe Stringer <joe@wand.net.nz> Reviewed-by: Julian Anastasov <ja@ssi.bg> Acked-by: Simon Horman <horms@verge.net.au> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r--net/sctp/input.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 7993495a4c0f..fa91aff02388 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -87,15 +87,7 @@ static inline int sctp_rcv_checksum(struct net *net, struct sk_buff *skb)
{
struct sctphdr *sh = sctp_hdr(skb);
__le32 cmp = sh->checksum;
- struct sk_buff *list;
- __le32 val;
- __u32 tmp = sctp_start_cksum((__u8 *)sh, skb_headlen(skb));
-
- skb_walk_frags(skb, list)
- tmp = sctp_update_cksum((__u8 *)list->data, skb_headlen(list),
- tmp);
-
- val = sctp_end_cksum(tmp);
+ __le32 val = sctp_compute_cksum(skb, 0);
if (val != cmp) {
/* CRC failure, dump it. */