diff options
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r-- | net/sctp/input.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index 9311b5ddf5c0..3a322c584c74 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -79,14 +79,10 @@ static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb); | |||
79 | /* Calculate the SCTP checksum of an SCTP packet. */ | 79 | /* Calculate the SCTP checksum of an SCTP packet. */ |
80 | static inline int sctp_rcv_checksum(struct sk_buff *skb) | 80 | static inline int sctp_rcv_checksum(struct sk_buff *skb) |
81 | { | 81 | { |
82 | struct sctphdr *sh; | ||
83 | __u32 cmp, val; | ||
84 | struct sk_buff *list = skb_shinfo(skb)->frag_list; | 82 | struct sk_buff *list = skb_shinfo(skb)->frag_list; |
85 | 83 | struct sctphdr *sh = sctp_hdr(skb); | |
86 | sh = (struct sctphdr *) skb->h.raw; | 84 | __u32 cmp = ntohl(sh->checksum); |
87 | cmp = ntohl(sh->checksum); | 85 | __u32 val = sctp_start_cksum((__u8 *)sh, skb_headlen(skb)); |
88 | |||
89 | val = sctp_start_cksum((__u8 *)sh, skb_headlen(skb)); | ||
90 | 86 | ||
91 | for (; list; list = list->next) | 87 | for (; list; list = list->next) |
92 | val = sctp_update_cksum((__u8 *)list->data, skb_headlen(list), | 88 | val = sctp_update_cksum((__u8 *)list->data, skb_headlen(list), |
@@ -138,7 +134,7 @@ int sctp_rcv(struct sk_buff *skb) | |||
138 | if (skb_linearize(skb)) | 134 | if (skb_linearize(skb)) |
139 | goto discard_it; | 135 | goto discard_it; |
140 | 136 | ||
141 | sh = (struct sctphdr *) skb->h.raw; | 137 | sh = sctp_hdr(skb); |
142 | 138 | ||
143 | /* Pull up the IP and SCTP headers. */ | 139 | /* Pull up the IP and SCTP headers. */ |
144 | __skb_pull(skb, skb_transport_offset(skb)); | 140 | __skb_pull(skb, skb_transport_offset(skb)); |
@@ -905,7 +901,7 @@ static struct sctp_association *__sctp_rcv_init_lookup(struct sk_buff *skb, | |||
905 | struct sctp_association *asoc; | 901 | struct sctp_association *asoc; |
906 | union sctp_addr addr; | 902 | union sctp_addr addr; |
907 | union sctp_addr *paddr = &addr; | 903 | union sctp_addr *paddr = &addr; |
908 | struct sctphdr *sh = (struct sctphdr *) skb->h.raw; | 904 | struct sctphdr *sh = sctp_hdr(skb); |
909 | sctp_chunkhdr_t *ch; | 905 | sctp_chunkhdr_t *ch; |
910 | union sctp_params params; | 906 | union sctp_params params; |
911 | sctp_init_chunk_t *init; | 907 | sctp_init_chunk_t *init; |