aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/input.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-13 12:59:32 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:19 -0400
commit2c0fd387b00a6758550b5ca1aae4408374483fe7 (patch)
treee6bd255fb77d476424345c7864f6ee14cb0d1ddc /net/sctp/input.c
parent967b05f64e27d04a4c8879addd0e1c52137e2c9e (diff)
[SCTP]: Introduce sctp_hdr()
For consistency with all the other skb->h.raw accessors. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r--net/sctp/input.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 9311b5ddf5c..3a322c584c7 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. */
80static inline int sctp_rcv_checksum(struct sk_buff *skb) 80static 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;