aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sctp/associola.c10
-rw-r--r--net/sctp/bind_addr.c12
-rw-r--r--net/sctp/crc32c.c38
-rw-r--r--net/sctp/debug.c32
-rw-r--r--net/sctp/endpointola.c2
-rw-r--r--net/sctp/input.c16
-rw-r--r--net/sctp/inqueue.c34
-rw-r--r--net/sctp/ipv6.c2
-rw-r--r--net/sctp/objcnt.c34
-rw-r--r--net/sctp/output.c12
-rw-r--r--net/sctp/outqueue.c30
-rw-r--r--net/sctp/primitive.c4
-rw-r--r--net/sctp/proc.c4
-rw-r--r--net/sctp/protocol.c24
-rw-r--r--net/sctp/sm_make_chunk.c88
-rw-r--r--net/sctp/sm_sideeffect.c68
-rw-r--r--net/sctp/sm_statefuns.c110
-rw-r--r--net/sctp/sm_statetable.c2
-rw-r--r--net/sctp/socket.c114
-rw-r--r--net/sctp/transport.c14
-rw-r--r--net/sctp/tsnmap.c2
-rw-r--r--net/sctp/ulpevent.c22
-rw-r--r--net/sctp/ulpqueue.c60
23 files changed, 367 insertions, 367 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 5db95caed0a3..fca6f75b0a0d 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -158,14 +158,14 @@ static struct sctp_association *sctp_association_init(struct sctp_association *a
158 * If the 'T5-shutdown-guard' timer is used, it SHOULD be set to the 158 * If the 'T5-shutdown-guard' timer is used, it SHOULD be set to the
159 * recommended value of 5 times 'RTO.Max'. 159 * recommended value of 5 times 'RTO.Max'.
160 */ 160 */
161 asoc->timeouts[SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD] 161 asoc->timeouts[SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD]
162 = 5 * asoc->rto_max; 162 = 5 * asoc->rto_max;
163 163
164 asoc->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = 0; 164 asoc->timeouts[SCTP_EVENT_TIMEOUT_HEARTBEAT] = 0;
165 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = asoc->sackdelay; 165 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = asoc->sackdelay;
166 asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] = 166 asoc->timeouts[SCTP_EVENT_TIMEOUT_AUTOCLOSE] =
167 sp->autoclose * HZ; 167 sp->autoclose * HZ;
168 168
169 /* Initilizes the timers */ 169 /* Initilizes the timers */
170 for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i) { 170 for (i = SCTP_EVENT_TIMEOUT_NONE; i < SCTP_NUM_TIMEOUT_TYPES; ++i) {
171 init_timer(&asoc->timers[i]); 171 init_timer(&asoc->timers[i]);
@@ -1334,8 +1334,8 @@ int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *asoc,
1334 asoc->ep->base.bind_addr.port, gfp); 1334 asoc->ep->base.bind_addr.port, gfp);
1335} 1335}
1336 1336
1337/* Lookup laddr in the bind address list of an association. */ 1337/* Lookup laddr in the bind address list of an association. */
1338int sctp_assoc_lookup_laddr(struct sctp_association *asoc, 1338int sctp_assoc_lookup_laddr(struct sctp_association *asoc,
1339 const union sctp_addr *laddr) 1339 const union sctp_addr *laddr)
1340{ 1340{
1341 int found; 1341 int found;
@@ -1343,7 +1343,7 @@ int sctp_assoc_lookup_laddr(struct sctp_association *asoc,
1343 sctp_read_lock(&asoc->base.addr_lock); 1343 sctp_read_lock(&asoc->base.addr_lock);
1344 if ((asoc->base.bind_addr.port == ntohs(laddr->v4.sin_port)) && 1344 if ((asoc->base.bind_addr.port == ntohs(laddr->v4.sin_port)) &&
1345 sctp_bind_addr_match(&asoc->base.bind_addr, laddr, 1345 sctp_bind_addr_match(&asoc->base.bind_addr, laddr,
1346 sctp_sk(asoc->base.sk))) { 1346 sctp_sk(asoc->base.sk))) {
1347 found = 1; 1347 found = 1;
1348 goto out; 1348 goto out;
1349 } 1349 }
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 00994158e496..80294cbc0de6 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -62,7 +62,7 @@ static void sctp_bind_addr_clean(struct sctp_bind_addr *);
62/* Copy 'src' to 'dest' taking 'scope' into account. Omit addresses 62/* Copy 'src' to 'dest' taking 'scope' into account. Omit addresses
63 * in 'src' which have a broader scope than 'scope'. 63 * in 'src' which have a broader scope than 'scope'.
64 */ 64 */
65int sctp_bind_addr_copy(struct sctp_bind_addr *dest, 65int sctp_bind_addr_copy(struct sctp_bind_addr *dest,
66 const struct sctp_bind_addr *src, 66 const struct sctp_bind_addr *src,
67 sctp_scope_t scope, gfp_t gfp, 67 sctp_scope_t scope, gfp_t gfp,
68 int flags) 68 int flags)
@@ -296,7 +296,7 @@ int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw_addr_list,
296 ********************************************************************/ 296 ********************************************************************/
297 297
298/* Does this contain a specified address? Allow wildcarding. */ 298/* Does this contain a specified address? Allow wildcarding. */
299int sctp_bind_addr_match(struct sctp_bind_addr *bp, 299int sctp_bind_addr_match(struct sctp_bind_addr *bp,
300 const union sctp_addr *addr, 300 const union sctp_addr *addr,
301 struct sctp_sock *opt) 301 struct sctp_sock *opt)
302{ 302{
@@ -306,7 +306,7 @@ int sctp_bind_addr_match(struct sctp_bind_addr *bp,
306 list_for_each(pos, &bp->address_list) { 306 list_for_each(pos, &bp->address_list) {
307 laddr = list_entry(pos, struct sctp_sockaddr_entry, list); 307 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
308 if (opt->pf->cmp_addr(&laddr->a, addr, opt)) 308 if (opt->pf->cmp_addr(&laddr->a, addr, opt))
309 return 1; 309 return 1;
310 } 310 }
311 311
312 return 0; 312 return 0;
@@ -329,12 +329,12 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
329 329
330 list_for_each(pos, &bp->address_list) { 330 list_for_each(pos, &bp->address_list) {
331 laddr = list_entry(pos, struct sctp_sockaddr_entry, list); 331 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
332 332
333 addr_buf = (union sctp_addr *)addrs; 333 addr_buf = (union sctp_addr *)addrs;
334 for (i = 0; i < addrcnt; i++) { 334 for (i = 0; i < addrcnt; i++) {
335 addr = (union sctp_addr *)addr_buf; 335 addr = (union sctp_addr *)addr_buf;
336 af = sctp_get_af_specific(addr->v4.sin_family); 336 af = sctp_get_af_specific(addr->v4.sin_family);
337 if (!af) 337 if (!af)
338 return NULL; 338 return NULL;
339 339
340 if (opt->pf->cmp_addr(&laddr->a, addr, opt)) 340 if (opt->pf->cmp_addr(&laddr->a, addr, opt))
@@ -350,7 +350,7 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
350} 350}
351 351
352/* Copy out addresses from the global local address list. */ 352/* Copy out addresses from the global local address list. */
353static int sctp_copy_one_addr(struct sctp_bind_addr *dest, 353static int sctp_copy_one_addr(struct sctp_bind_addr *dest,
354 union sctp_addr *addr, 354 union sctp_addr *addr,
355 sctp_scope_t scope, gfp_t gfp, 355 sctp_scope_t scope, gfp_t gfp,
356 int flags) 356 int flags)
diff --git a/net/sctp/crc32c.c b/net/sctp/crc32c.c
index 31f05ec8e1d3..59cf7b06d216 100644
--- a/net/sctp/crc32c.c
+++ b/net/sctp/crc32c.c
@@ -1,40 +1,40 @@
1/* SCTP kernel reference Implementation 1/* SCTP kernel reference Implementation
2 * Copyright (c) 1999-2001 Motorola, Inc. 2 * Copyright (c) 1999-2001 Motorola, Inc.
3 * Copyright (c) 2001-2003 International Business Machines, Corp. 3 * Copyright (c) 2001-2003 International Business Machines, Corp.
4 * 4 *
5 * This file is part of the SCTP kernel reference Implementation 5 * This file is part of the SCTP kernel reference Implementation
6 * 6 *
7 * SCTP Checksum functions 7 * SCTP Checksum functions
8 * 8 *
9 * The SCTP reference implementation is free software; 9 * The SCTP reference implementation is free software;
10 * you can redistribute it and/or modify it under the terms of 10 * you can redistribute it and/or modify it under the terms of
11 * the GNU General Public License as published by 11 * the GNU General Public License as published by
12 * the Free Software Foundation; either version 2, or (at your option) 12 * the Free Software Foundation; either version 2, or (at your option)
13 * any later version. 13 * any later version.
14 * 14 *
15 * The SCTP reference implementation is distributed in the hope that it 15 * The SCTP reference implementation is distributed in the hope that it
16 * will be useful, but WITHOUT ANY WARRANTY; without even the implied 16 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
17 * ************************ 17 * ************************
18 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 18 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 * See the GNU General Public License for more details. 19 * See the GNU General Public License for more details.
20 * 20 *
21 * You should have received a copy of the GNU General Public License 21 * You should have received a copy of the GNU General Public License
22 * along with GNU CC; see the file COPYING. If not, write to 22 * along with GNU CC; see the file COPYING. If not, write to
23 * the Free Software Foundation, 59 Temple Place - Suite 330, 23 * the Free Software Foundation, 59 Temple Place - Suite 330,
24 * Boston, MA 02111-1307, USA. 24 * Boston, MA 02111-1307, USA.
25 * 25 *
26 * Please send any bug reports or fixes you make to the 26 * Please send any bug reports or fixes you make to the
27 * email address(es): 27 * email address(es):
28 * lksctp developers <lksctp-developers@lists.sourceforge.net> 28 * lksctp developers <lksctp-developers@lists.sourceforge.net>
29 * 29 *
30 * Or submit a bug report through the following website: 30 * Or submit a bug report through the following website:
31 * http://www.sf.net/projects/lksctp 31 * http://www.sf.net/projects/lksctp
32 * 32 *
33 * Written or modified by: 33 * Written or modified by:
34 * Dinakaran Joseph 34 * Dinakaran Joseph
35 * Jon Grimm <jgrimm@us.ibm.com> 35 * Jon Grimm <jgrimm@us.ibm.com>
36 * Sridhar Samudrala <sri@us.ibm.com> 36 * Sridhar Samudrala <sri@us.ibm.com>
37 * 37 *
38 * Any bugs reported given to us we will try to fix... any fixes shared will 38 * Any bugs reported given to us we will try to fix... any fixes shared will
39 * be incorporated into the next SCTP release. 39 * be incorporated into the next SCTP release.
40 */ 40 */
@@ -135,10 +135,10 @@ static const __u32 crc_c[256] = {
135 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E, 135 0x79B737BA, 0x8BDCB4B9, 0x988C474D, 0x6AE7C44E,
136 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351, 136 0xBE2DA0A5, 0x4C4623A6, 0x5F16D052, 0xAD7D5351,
137}; 137};
138 138
139__u32 sctp_start_cksum(__u8 *buffer, __u16 length) 139__u32 sctp_start_cksum(__u8 *buffer, __u16 length)
140{ 140{
141 __u32 crc32 = ~(__u32) 0; 141 __u32 crc32 = ~(__u32) 0;
142 __u32 i; 142 __u32 i;
143 143
144 /* Optimize this routine to be SCTP specific, knowing how 144 /* Optimize this routine to be SCTP specific, knowing how
@@ -147,7 +147,7 @@ __u32 sctp_start_cksum(__u8 *buffer, __u16 length)
147 147
148 /* Calculate CRC up to the checksum. */ 148 /* Calculate CRC up to the checksum. */
149 for (i = 0; i < (sizeof(struct sctphdr) - sizeof(__u32)); i++) 149 for (i = 0; i < (sizeof(struct sctphdr) - sizeof(__u32)); i++)
150 CRC32C(crc32, buffer[i]); 150 CRC32C(crc32, buffer[i]);
151 151
152 /* Skip checksum field of the header. */ 152 /* Skip checksum field of the header. */
153 for (i = 0; i < sizeof(__u32); i++) 153 for (i = 0; i < sizeof(__u32); i++)
@@ -175,13 +175,13 @@ __u32 sctp_update_copy_cksum(__u8 *to, __u8 *from, __u16 length, __u32 crc32)
175 __u32 i; 175 __u32 i;
176 __u32 *_to = (__u32 *)to; 176 __u32 *_to = (__u32 *)to;
177 __u32 *_from = (__u32 *)from; 177 __u32 *_from = (__u32 *)from;
178 178
179 for (i = 0; i < (length/4); i++) { 179 for (i = 0; i < (length/4); i++) {
180 _to[i] = _from[i]; 180 _to[i] = _from[i];
181 CRC32C(crc32, from[i*4]); 181 CRC32C(crc32, from[i*4]);
182 CRC32C(crc32, from[i*4+1]); 182 CRC32C(crc32, from[i*4+1]);
183 CRC32C(crc32, from[i*4+2]); 183 CRC32C(crc32, from[i*4+2]);
184 CRC32C(crc32, from[i*4+3]); 184 CRC32C(crc32, from[i*4+3]);
185 } 185 }
186 186
187 return crc32; 187 return crc32;
diff --git a/net/sctp/debug.c b/net/sctp/debug.c
index aa8340373af7..5f5ab28977c9 100644
--- a/net/sctp/debug.c
+++ b/net/sctp/debug.c
@@ -3,48 +3,48 @@
3 * Copyright (c) 1999-2000 Cisco, Inc. 3 * Copyright (c) 1999-2000 Cisco, Inc.
4 * Copyright (c) 1999-2001 Motorola, Inc. 4 * Copyright (c) 1999-2001 Motorola, Inc.
5 * Copyright (c) 2001 Intel Corp. 5 * Copyright (c) 2001 Intel Corp.
6 * 6 *
7 * This file is part of the SCTP kernel reference Implementation 7 * This file is part of the SCTP kernel reference Implementation
8 * 8 *
9 * This file is part of the implementation of the add-IP extension, 9 * This file is part of the implementation of the add-IP extension,
10 * based on <draft-ietf-tsvwg-addip-sctp-02.txt> June 29, 2001, 10 * based on <draft-ietf-tsvwg-addip-sctp-02.txt> June 29, 2001,
11 * for the SCTP kernel reference Implementation. 11 * for the SCTP kernel reference Implementation.
12 * 12 *
13 * This file converts numerical ID value to alphabetical names for SCTP 13 * This file converts numerical ID value to alphabetical names for SCTP
14 * terms such as chunk type, parameter time, event type, etc. 14 * terms such as chunk type, parameter time, event type, etc.
15 * 15 *
16 * The SCTP reference implementation is free software; 16 * The SCTP reference implementation is free software;
17 * you can redistribute it and/or modify it under the terms of 17 * you can redistribute it and/or modify it under the terms of
18 * the GNU General Public License as published by 18 * the GNU General Public License as published by
19 * the Free Software Foundation; either version 2, or (at your option) 19 * the Free Software Foundation; either version 2, or (at your option)
20 * any later version. 20 * any later version.
21 * 21 *
22 * The SCTP reference implementation is distributed in the hope that it 22 * The SCTP reference implementation is distributed in the hope that it
23 * will be useful, but WITHOUT ANY WARRANTY; without even the implied 23 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
24 * ************************ 24 * ************************
25 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 25 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
26 * See the GNU General Public License for more details. 26 * See the GNU General Public License for more details.
27 * 27 *
28 * You should have received a copy of the GNU General Public License 28 * You should have received a copy of the GNU General Public License
29 * along with GNU CC; see the file COPYING. If not, write to 29 * along with GNU CC; see the file COPYING. If not, write to
30 * the Free Software Foundation, 59 Temple Place - Suite 330, 30 * the Free Software Foundation, 59 Temple Place - Suite 330,
31 * Boston, MA 02111-1307, USA. 31 * Boston, MA 02111-1307, USA.
32 * 32 *
33 * Please send any bug reports or fixes you make to the 33 * Please send any bug reports or fixes you make to the
34 * email address(es): 34 * email address(es):
35 * lksctp developers <lksctp-developers@lists.sourceforge.net> 35 * lksctp developers <lksctp-developers@lists.sourceforge.net>
36 * 36 *
37 * Or submit a bug report through the following website: 37 * Or submit a bug report through the following website:
38 * http://www.sf.net/projects/lksctp 38 * http://www.sf.net/projects/lksctp
39 * 39 *
40 * Written or modified by: 40 * Written or modified by:
41 * La Monte H.P. Yarroll <piggy@acm.org> 41 * La Monte H.P. Yarroll <piggy@acm.org>
42 * Karl Knutson <karl@athena.chicago.il.us> 42 * Karl Knutson <karl@athena.chicago.il.us>
43 * Xingang Guo <xingang.guo@intel.com> 43 * Xingang Guo <xingang.guo@intel.com>
44 * Jon Grimm <jgrimm@us.ibm.com> 44 * Jon Grimm <jgrimm@us.ibm.com>
45 * Daisy Chang <daisyc@us.ibm.com> 45 * Daisy Chang <daisyc@us.ibm.com>
46 * Sridhar Samudrala <sri@us.ibm.com> 46 * Sridhar Samudrala <sri@us.ibm.com>
47 * 47 *
48 * Any bugs reported given to us we will try to fix... any fixes shared will 48 * Any bugs reported given to us we will try to fix... any fixes shared will
49 * be incorporated into the next SCTP release. 49 * be incorporated into the next SCTP release.
50 */ 50 */
@@ -81,7 +81,7 @@ const char *sctp_cname(const sctp_subtype_t cid)
81 return "illegal chunk id"; 81 return "illegal chunk id";
82 if (cid.chunk <= SCTP_CID_BASE_MAX) 82 if (cid.chunk <= SCTP_CID_BASE_MAX)
83 return sctp_cid_tbl[cid.chunk]; 83 return sctp_cid_tbl[cid.chunk];
84 84
85 switch (cid.chunk) { 85 switch (cid.chunk) {
86 case SCTP_CID_ASCONF: 86 case SCTP_CID_ASCONF:
87 return "ASCONF"; 87 return "ASCONF";
@@ -154,7 +154,7 @@ const char *sctp_pname(const sctp_subtype_t id)
154 154
155static const char *sctp_other_tbl[] = { 155static const char *sctp_other_tbl[] = {
156 "NO_PENDING_TSN", 156 "NO_PENDING_TSN",
157 "ICMP_PROTO_UNREACH", 157 "ICMP_PROTO_UNREACH",
158}; 158};
159 159
160/* Lookup "other" debug name. */ 160/* Lookup "other" debug name. */
diff --git a/net/sctp/endpointola.c b/net/sctp/endpointola.c
index 129756908da4..286a8dbb63b7 100644
--- a/net/sctp/endpointola.c
+++ b/net/sctp/endpointola.c
@@ -369,7 +369,7 @@ static void sctp_endpoint_bh_rcv(struct work_struct *work)
369 chunk->transport->last_time_heard = jiffies; 369 chunk->transport->last_time_heard = jiffies;
370 370
371 error = sctp_do_sm(SCTP_EVENT_T_CHUNK, subtype, state, 371 error = sctp_do_sm(SCTP_EVENT_T_CHUNK, subtype, state,
372 ep, asoc, chunk, GFP_ATOMIC); 372 ep, asoc, chunk, GFP_ATOMIC);
373 373
374 if (error && chunk) 374 if (error && chunk)
375 chunk->pdiscard = 1; 375 chunk->pdiscard = 1;
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 33111873a488..71db66873695 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -226,7 +226,7 @@ int sctp_rcv(struct sk_buff *skb)
226 nf_reset(skb); 226 nf_reset(skb);
227 227
228 if (sk_filter(sk, skb)) 228 if (sk_filter(sk, skb))
229 goto discard_release; 229 goto discard_release;
230 230
231 /* Create an SCTP packet structure. */ 231 /* Create an SCTP packet structure. */
232 chunk = sctp_chunkify(skb, asoc, sk); 232 chunk = sctp_chunkify(skb, asoc, sk);
@@ -293,11 +293,11 @@ discard_release:
293int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) 293int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb)
294{ 294{
295 struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk; 295 struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk;
296 struct sctp_inq *inqueue = &chunk->rcvr->inqueue; 296 struct sctp_inq *inqueue = &chunk->rcvr->inqueue;
297 struct sctp_ep_common *rcvr = NULL; 297 struct sctp_ep_common *rcvr = NULL;
298 int backloged = 0; 298 int backloged = 0;
299 299
300 rcvr = chunk->rcvr; 300 rcvr = chunk->rcvr;
301 301
302 /* If the rcvr is dead then the association or endpoint 302 /* If the rcvr is dead then the association or endpoint
303 * has been deleted and we can safely drop the chunk 303 * has been deleted and we can safely drop the chunk
@@ -347,7 +347,7 @@ done:
347 else 347 else
348 BUG(); 348 BUG();
349 349
350 return 0; 350 return 0;
351} 351}
352 352
353static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb) 353static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb)
@@ -399,7 +399,7 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
399 * Normally, if PMTU discovery is disabled, an ICMP Fragmentation 399 * Normally, if PMTU discovery is disabled, an ICMP Fragmentation
400 * Needed will never be sent, but if a message was sent before 400 * Needed will never be sent, but if a message was sent before
401 * PMTU discovery was disabled that was larger than the PMTU, it 401 * PMTU discovery was disabled that was larger than the PMTU, it
402 * would not be fragmented, so it must be re-transmitted fragmented. 402 * would not be fragmented, so it must be re-transmitted fragmented.
403 */ 403 */
404 sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD); 404 sctp_retransmit(&asoc->outqueue, t, SCTP_RTXR_PMTUD);
405} 405}
@@ -416,8 +416,8 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
416 * 416 *
417 */ 417 */
418void sctp_icmp_proto_unreachable(struct sock *sk, 418void sctp_icmp_proto_unreachable(struct sock *sk,
419 struct sctp_association *asoc, 419 struct sctp_association *asoc,
420 struct sctp_transport *t) 420 struct sctp_transport *t)
421{ 421{
422 SCTP_DEBUG_PRINTK("%s\n", __FUNCTION__); 422 SCTP_DEBUG_PRINTK("%s\n", __FUNCTION__);
423 423
diff --git a/net/sctp/inqueue.c b/net/sctp/inqueue.c
index 71b07466e880..c30629e17781 100644
--- a/net/sctp/inqueue.c
+++ b/net/sctp/inqueue.c
@@ -2,43 +2,43 @@
2 * Copyright (c) 1999-2000 Cisco, Inc. 2 * Copyright (c) 1999-2000 Cisco, Inc.
3 * Copyright (c) 1999-2001 Motorola, Inc. 3 * Copyright (c) 1999-2001 Motorola, Inc.
4 * Copyright (c) 2002 International Business Machines, Corp. 4 * Copyright (c) 2002 International Business Machines, Corp.
5 * 5 *
6 * This file is part of the SCTP kernel reference Implementation 6 * This file is part of the SCTP kernel reference Implementation
7 * 7 *
8 * These functions are the methods for accessing the SCTP inqueue. 8 * These functions are the methods for accessing the SCTP inqueue.
9 * 9 *
10 * An SCTP inqueue is a queue into which you push SCTP packets 10 * An SCTP inqueue is a queue into which you push SCTP packets
11 * (which might be bundles or fragments of chunks) and out of which you 11 * (which might be bundles or fragments of chunks) and out of which you
12 * pop SCTP whole chunks. 12 * pop SCTP whole chunks.
13 * 13 *
14 * The SCTP reference implementation is free software; 14 * The SCTP reference implementation is free software;
15 * you can redistribute it and/or modify it under the terms of 15 * you can redistribute it and/or modify it under the terms of
16 * the GNU General Public License as published by 16 * the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option) 17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version. 18 * any later version.
19 * 19 *
20 * The SCTP reference implementation is distributed in the hope that it 20 * The SCTP reference implementation is distributed in the hope that it
21 * will be useful, but WITHOUT ANY WARRANTY; without even the implied 21 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
22 * ************************ 22 * ************************
23 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 23 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 * See the GNU General Public License for more details. 24 * See the GNU General Public License for more details.
25 * 25 *
26 * You should have received a copy of the GNU General Public License 26 * You should have received a copy of the GNU General Public License
27 * along with GNU CC; see the file COPYING. If not, write to 27 * along with GNU CC; see the file COPYING. If not, write to
28 * the Free Software Foundation, 59 Temple Place - Suite 330, 28 * the Free Software Foundation, 59 Temple Place - Suite 330,
29 * Boston, MA 02111-1307, USA. 29 * Boston, MA 02111-1307, USA.
30 * 30 *
31 * Please send any bug reports or fixes you make to the 31 * Please send any bug reports or fixes you make to the
32 * email address(es): 32 * email address(es):
33 * lksctp developers <lksctp-developers@lists.sourceforge.net> 33 * lksctp developers <lksctp-developers@lists.sourceforge.net>
34 * 34 *
35 * Or submit a bug report through the following website: 35 * Or submit a bug report through the following website:
36 * http://www.sf.net/projects/lksctp 36 * http://www.sf.net/projects/lksctp
37 * 37 *
38 * Written or modified by: 38 * Written or modified by:
39 * La Monte H.P. Yarroll <piggy@acm.org> 39 * La Monte H.P. Yarroll <piggy@acm.org>
40 * Karl Knutson <karl@athena.chicago.il.us> 40 * Karl Knutson <karl@athena.chicago.il.us>
41 * 41 *
42 * Any bugs reported given to us we will try to fix... any fixes shared will 42 * Any bugs reported given to us we will try to fix... any fixes shared will
43 * be incorporated into the next SCTP release. 43 * be incorporated into the next SCTP release.
44 */ 44 */
@@ -152,8 +152,8 @@ struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue)
152 chunk->data_accepted = 0; 152 chunk->data_accepted = 0;
153 } 153 }
154 154
155 chunk->chunk_hdr = ch; 155 chunk->chunk_hdr = ch;
156 chunk->chunk_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length)); 156 chunk->chunk_end = ((__u8 *)ch) + WORD_ROUND(ntohs(ch->length));
157 /* In the unlikely case of an IP reassembly, the skb could be 157 /* In the unlikely case of an IP reassembly, the skb could be
158 * non-linear. If so, update chunk_end so that it doesn't go past 158 * non-linear. If so, update chunk_end so that it doesn't go past
159 * the skb->tail. 159 * the skb->tail.
@@ -169,11 +169,11 @@ struct sctp_chunk *sctp_inq_pop(struct sctp_inq *queue)
169 /* This is not a singleton */ 169 /* This is not a singleton */
170 chunk->singleton = 0; 170 chunk->singleton = 0;
171 } else if (chunk->chunk_end > chunk->skb->tail) { 171 } else if (chunk->chunk_end > chunk->skb->tail) {
172 /* RFC 2960, Section 6.10 Bundling 172 /* RFC 2960, Section 6.10 Bundling
173 * 173 *
174 * Partial chunks MUST NOT be placed in an SCTP packet. 174 * Partial chunks MUST NOT be placed in an SCTP packet.
175 * If the receiver detects a partial chunk, it MUST drop 175 * If the receiver detects a partial chunk, it MUST drop
176 * the chunk. 176 * the chunk.
177 * 177 *
178 * Since the end of the chunk is past the end of our buffer 178 * Since the end of the chunk is past the end of our buffer
179 * (which contains the whole packet, we can freely discard 179 * (which contains the whole packet, we can freely discard
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index ef36be073a13..01b27fb5dfc5 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -236,7 +236,7 @@ static struct dst_entry *sctp_v6_get_dst(struct sctp_association *asoc,
236 ipv6_addr_copy(&fl.fl6_dst, &daddr->v6.sin6_addr); 236 ipv6_addr_copy(&fl.fl6_dst, &daddr->v6.sin6_addr);
237 if (ipv6_addr_type(&daddr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL) 237 if (ipv6_addr_type(&daddr->v6.sin6_addr) & IPV6_ADDR_LINKLOCAL)
238 fl.oif = daddr->v6.sin6_scope_id; 238 fl.oif = daddr->v6.sin6_scope_id;
239 239
240 240
241 SCTP_DEBUG_PRINTK("%s: DST=" NIP6_FMT " ", 241 SCTP_DEBUG_PRINTK("%s: DST=" NIP6_FMT " ",
242 __FUNCTION__, NIP6(fl.fl6_dst)); 242 __FUNCTION__, NIP6(fl.fl6_dst));
diff --git a/net/sctp/objcnt.c b/net/sctp/objcnt.c
index 8ff588f0d76a..fcfb9d806de1 100644
--- a/net/sctp/objcnt.c
+++ b/net/sctp/objcnt.c
@@ -1,39 +1,39 @@
1/* SCTP kernel reference Implementation 1/* SCTP kernel reference Implementation
2 * (C) Copyright IBM Corp. 2001, 2004 2 * (C) Copyright IBM Corp. 2001, 2004
3 * 3 *
4 * This file is part of the SCTP kernel reference Implementation 4 * This file is part of the SCTP kernel reference Implementation
5 * 5 *
6 * Support for memory object debugging. This allows one to monitor the 6 * Support for memory object debugging. This allows one to monitor the
7 * object allocations/deallocations for types instrumented for this 7 * object allocations/deallocations for types instrumented for this
8 * via the proc fs. 8 * via the proc fs.
9 * 9 *
10 * The SCTP reference implementation is free software; 10 * The SCTP reference implementation is free software;
11 * you can redistribute it and/or modify it under the terms of 11 * you can redistribute it and/or modify it under the terms of
12 * the GNU General Public License as published by 12 * the GNU General Public License as published by
13 * the Free Software Foundation; either version 2, or (at your option) 13 * the Free Software Foundation; either version 2, or (at your option)
14 * any later version. 14 * any later version.
15 * 15 *
16 * The SCTP reference implementation is distributed in the hope that it 16 * The SCTP reference implementation is distributed in the hope that it
17 * will be useful, but WITHOUT ANY WARRANTY; without even the implied 17 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
18 * ************************ 18 * ************************
19 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 19 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 * See the GNU General Public License for more details. 20 * See the GNU General Public License for more details.
21 * 21 *
22 * You should have received a copy of the GNU General Public License 22 * You should have received a copy of the GNU General Public License
23 * along with GNU CC; see the file COPYING. If not, write to 23 * along with GNU CC; see the file COPYING. If not, write to
24 * the Free Software Foundation, 59 Temple Place - Suite 330, 24 * the Free Software Foundation, 59 Temple Place - Suite 330,
25 * Boston, MA 02111-1307, USA. 25 * Boston, MA 02111-1307, USA.
26 * 26 *
27 * Please send any bug reports or fixes you make to the 27 * Please send any bug reports or fixes you make to the
28 * email address(es): 28 * email address(es):
29 * lksctp developers <lksctp-developers@lists.sourceforge.net> 29 * lksctp developers <lksctp-developers@lists.sourceforge.net>
30 * 30 *
31 * Or submit a bug report through the following website: 31 * Or submit a bug report through the following website:
32 * http://www.sf.net/projects/lksctp 32 * http://www.sf.net/projects/lksctp
33 * 33 *
34 * Written or modified by: 34 * Written or modified by:
35 * Jon Grimm <jgrimm@us.ibm.com> 35 * Jon Grimm <jgrimm@us.ibm.com>
36 * 36 *
37 * Any bugs reported given to us we will try to fix... any fixes shared will 37 * Any bugs reported given to us we will try to fix... any fixes shared will
38 * be incorporated into the next SCTP release. 38 * be incorporated into the next SCTP release.
39 */ 39 */
@@ -121,7 +121,7 @@ done:
121 if (len > length) 121 if (len > length)
122 len = length; 122 len = length;
123 123
124 return len; 124 return len;
125} 125}
126 126
127/* Initialize the objcount in the proc filesystem. */ 127/* Initialize the objcount in the proc filesystem. */
@@ -131,7 +131,7 @@ void sctp_dbg_objcnt_init(void)
131 ent = create_proc_read_entry("sctp_dbg_objcnt", 0, proc_net_sctp, 131 ent = create_proc_read_entry("sctp_dbg_objcnt", 0, proc_net_sctp,
132 sctp_dbg_objcnt_read, NULL); 132 sctp_dbg_objcnt_read, NULL);
133 if (!ent) 133 if (!ent)
134 printk(KERN_WARNING 134 printk(KERN_WARNING
135 "sctp_dbg_objcnt: Unable to create /proc entry.\n"); 135 "sctp_dbg_objcnt: Unable to create /proc entry.\n");
136} 136}
137 137
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 3ef4351dd956..f875fc3ced54 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -85,8 +85,8 @@ struct sctp_packet *sctp_packet_config(struct sctp_packet *packet,
85 chunk = sctp_get_ecne_prepend(packet->transport->asoc); 85 chunk = sctp_get_ecne_prepend(packet->transport->asoc);
86 86
87 /* If there a is a prepend chunk stick it on the list before 87 /* If there a is a prepend chunk stick it on the list before
88 * any other chunks get appended. 88 * any other chunks get appended.
89 */ 89 */
90 if (chunk) 90 if (chunk)
91 sctp_packet_append_chunk(packet, chunk); 91 sctp_packet_append_chunk(packet, chunk);
92 } 92 }
@@ -110,8 +110,8 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *packet,
110 packet->destination_port = dport; 110 packet->destination_port = dport;
111 INIT_LIST_HEAD(&packet->chunk_list); 111 INIT_LIST_HEAD(&packet->chunk_list);
112 if (asoc) { 112 if (asoc) {
113 struct sctp_sock *sp = sctp_sk(asoc->base.sk); 113 struct sctp_sock *sp = sctp_sk(asoc->base.sk);
114 overhead = sp->pf->af->net_header_len; 114 overhead = sp->pf->af->net_header_len;
115 } else { 115 } else {
116 overhead = sizeof(struct ipv6hdr); 116 overhead = sizeof(struct ipv6hdr);
117 } 117 }
@@ -442,7 +442,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
442 * acknowledged or have failed. 442 * acknowledged or have failed.
443 */ 443 */
444 if (!sctp_chunk_is_data(chunk)) 444 if (!sctp_chunk_is_data(chunk))
445 sctp_chunk_free(chunk); 445 sctp_chunk_free(chunk);
446 } 446 }
447 447
448 /* Perform final transformation on checksum. */ 448 /* Perform final transformation on checksum. */
@@ -528,7 +528,7 @@ err:
528 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) { 528 list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) {
529 list_del_init(&chunk->list); 529 list_del_init(&chunk->list);
530 if (!sctp_chunk_is_data(chunk)) 530 if (!sctp_chunk_is_data(chunk))
531 sctp_chunk_free(chunk); 531 sctp_chunk_free(chunk);
532 } 532 }
533 goto out; 533 goto out;
534nomem: 534nomem:
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index fba567a7cb64..5c2ddd10db06 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -376,7 +376,7 @@ static void sctp_insert_list(struct list_head *head, struct list_head *new)
376 } 376 }
377 } 377 }
378 if (!done) 378 if (!done)
379 list_add_tail(new, head); 379 list_add_tail(new, head);
380} 380}
381 381
382/* Mark all the eligible packets on a transport for retransmission. */ 382/* Mark all the eligible packets on a transport for retransmission. */
@@ -578,7 +578,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
578 break; 578 break;
579 579
580 case SCTP_XMIT_RWND_FULL: 580 case SCTP_XMIT_RWND_FULL:
581 /* Send this packet. */ 581 /* Send this packet. */
582 if ((error = sctp_packet_transmit(pkt)) == 0) 582 if ((error = sctp_packet_transmit(pkt)) == 0)
583 *start_timer = 1; 583 *start_timer = 1;
584 584
@@ -590,7 +590,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
590 break; 590 break;
591 591
592 case SCTP_XMIT_NAGLE_DELAY: 592 case SCTP_XMIT_NAGLE_DELAY:
593 /* Send this packet. */ 593 /* Send this packet. */
594 if ((error = sctp_packet_transmit(pkt)) == 0) 594 if ((error = sctp_packet_transmit(pkt)) == 0)
595 *start_timer = 1; 595 *start_timer = 1;
596 596
@@ -605,7 +605,7 @@ static int sctp_outq_flush_rtx(struct sctp_outq *q, struct sctp_packet *pkt,
605 */ 605 */
606 list_add_tail(lchunk, &transport->transmitted); 606 list_add_tail(lchunk, &transport->transmitted);
607 607
608 /* Mark the chunk as ineligible for fast retransmit 608 /* Mark the chunk as ineligible for fast retransmit
609 * after it is retransmitted. 609 * after it is retransmitted.
610 */ 610 */
611 if (chunk->fast_retransmit > 0) 611 if (chunk->fast_retransmit > 0)
@@ -703,11 +703,11 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
703 * inactive. 703 * inactive.
704 * 704 *
705 * 3.3.6 Heartbeat Acknowledgement: 705 * 3.3.6 Heartbeat Acknowledgement:
706 * ... 706 * ...
707 * A HEARTBEAT ACK is always sent to the source IP 707 * A HEARTBEAT ACK is always sent to the source IP
708 * address of the IP datagram containing the 708 * address of the IP datagram containing the
709 * HEARTBEAT chunk to which this ack is responding. 709 * HEARTBEAT chunk to which this ack is responding.
710 * ... 710 * ...
711 */ 711 */
712 if (chunk->chunk_hdr->type != SCTP_CID_HEARTBEAT && 712 if (chunk->chunk_hdr->type != SCTP_CID_HEARTBEAT &&
713 chunk->chunk_hdr->type != SCTP_CID_HEARTBEAT_ACK) 713 chunk->chunk_hdr->type != SCTP_CID_HEARTBEAT_ACK)
@@ -914,7 +914,7 @@ int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout)
914 BUG(); 914 BUG();
915 } 915 }
916 916
917 /* BUG: We assume that the sctp_packet_transmit() 917 /* BUG: We assume that the sctp_packet_transmit()
918 * call below will succeed all the time and add the 918 * call below will succeed all the time and add the
919 * chunk to the transmitted list and restart the 919 * chunk to the transmitted list and restart the
920 * timers. 920 * timers.
@@ -1266,7 +1266,7 @@ static void sctp_check_transmitted(struct sctp_outq *q,
1266 * first instance of the packet or a later 1266 * first instance of the packet or a later
1267 * instance). 1267 * instance).
1268 */ 1268 */
1269 if (!tchunk->tsn_gap_acked && 1269 if (!tchunk->tsn_gap_acked &&
1270 !tchunk->resent && 1270 !tchunk->resent &&
1271 tchunk->rtt_in_progress) { 1271 tchunk->rtt_in_progress) {
1272 tchunk->rtt_in_progress = 0; 1272 tchunk->rtt_in_progress = 0;
@@ -1275,7 +1275,7 @@ static void sctp_check_transmitted(struct sctp_outq *q,
1275 rtt); 1275 rtt);
1276 } 1276 }
1277 } 1277 }
1278 if (TSN_lte(tsn, sack_ctsn)) { 1278 if (TSN_lte(tsn, sack_ctsn)) {
1279 /* RFC 2960 6.3.2 Retransmission Timer Rules 1279 /* RFC 2960 6.3.2 Retransmission Timer Rules
1280 * 1280 *
1281 * R3) Whenever a SACK is received 1281 * R3) Whenever a SACK is received
@@ -1590,7 +1590,7 @@ static void sctp_mark_missing(struct sctp_outq *q,
1590 SCTP_DEBUG_PRINTK("%s: transport: %p, cwnd: %d, " 1590 SCTP_DEBUG_PRINTK("%s: transport: %p, cwnd: %d, "
1591 "ssthresh: %d, flight_size: %d, pba: %d\n", 1591 "ssthresh: %d, flight_size: %d, pba: %d\n",
1592 __FUNCTION__, transport, transport->cwnd, 1592 __FUNCTION__, transport, transport->cwnd,
1593 transport->ssthresh, transport->flight_size, 1593 transport->ssthresh, transport->flight_size,
1594 transport->partial_bytes_acked); 1594 transport->partial_bytes_acked);
1595 } 1595 }
1596} 1596}
@@ -1603,7 +1603,7 @@ static int sctp_acked(struct sctp_sackhdr *sack, __u32 tsn)
1603 __u16 gap; 1603 __u16 gap;
1604 __u32 ctsn = ntohl(sack->cum_tsn_ack); 1604 __u32 ctsn = ntohl(sack->cum_tsn_ack);
1605 1605
1606 if (TSN_lte(tsn, ctsn)) 1606 if (TSN_lte(tsn, ctsn))
1607 goto pass; 1607 goto pass;
1608 1608
1609 /* 3.3.4 Selective Acknowledgement (SACK) (3): 1609 /* 3.3.4 Selective Acknowledgement (SACK) (3):
@@ -1657,7 +1657,7 @@ static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 ctsn)
1657 1657
1658 /* PR-SCTP C1) Let SackCumAck be the Cumulative TSN ACK carried in the 1658 /* PR-SCTP C1) Let SackCumAck be the Cumulative TSN ACK carried in the
1659 * received SACK. 1659 * received SACK.
1660 * 1660 *
1661 * If (Advanced.Peer.Ack.Point < SackCumAck), then update 1661 * If (Advanced.Peer.Ack.Point < SackCumAck), then update
1662 * Advanced.Peer.Ack.Point to be equal to SackCumAck. 1662 * Advanced.Peer.Ack.Point to be equal to SackCumAck.
1663 */ 1663 */
@@ -1671,7 +1671,7 @@ static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 ctsn)
1671 * 1671 *
1672 * Assuming that a SACK arrived with the Cumulative TSN ACK 102 1672 * Assuming that a SACK arrived with the Cumulative TSN ACK 102
1673 * and the Advanced.Peer.Ack.Point is updated to this value: 1673 * and the Advanced.Peer.Ack.Point is updated to this value:
1674 * 1674 *
1675 * out-queue at the end of ==> out-queue after Adv.Ack.Point 1675 * out-queue at the end of ==> out-queue after Adv.Ack.Point
1676 * normal SACK processing local advancement 1676 * normal SACK processing local advancement
1677 * ... ... 1677 * ... ...
@@ -1692,7 +1692,7 @@ static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 ctsn)
1692 1692
1693 /* Remove any chunks in the abandoned queue that are acked by 1693 /* Remove any chunks in the abandoned queue that are acked by
1694 * the ctsn. 1694 * the ctsn.
1695 */ 1695 */
1696 if (TSN_lte(tsn, ctsn)) { 1696 if (TSN_lte(tsn, ctsn)) {
1697 list_del_init(lchunk); 1697 list_del_init(lchunk);
1698 if (!chunk->tsn_gap_acked) { 1698 if (!chunk->tsn_gap_acked) {
@@ -1743,7 +1743,7 @@ static void sctp_generate_fwdtsn(struct sctp_outq *q, __u32 ctsn)
1743 */ 1743 */
1744 if (asoc->adv_peer_ack_point > ctsn) 1744 if (asoc->adv_peer_ack_point > ctsn)
1745 ftsn_chunk = sctp_make_fwdtsn(asoc, asoc->adv_peer_ack_point, 1745 ftsn_chunk = sctp_make_fwdtsn(asoc, asoc->adv_peer_ack_point,
1746 nskips, &ftsn_skip_arr[0]); 1746 nskips, &ftsn_skip_arr[0]);
1747 1747
1748 if (ftsn_chunk) { 1748 if (ftsn_chunk) {
1749 list_add_tail(&ftsn_chunk->list, &q->control_chunk_list); 1749 list_add_tail(&ftsn_chunk->list, &q->control_chunk_list);
diff --git a/net/sctp/primitive.c b/net/sctp/primitive.c
index 3a7ebfcc1fdb..1b2976d34ac7 100644
--- a/net/sctp/primitive.c
+++ b/net/sctp/primitive.c
@@ -70,7 +70,7 @@ int sctp_primitive_ ## name(struct sctp_association *asoc, \
70 \ 70 \
71 error = sctp_do_sm(event_type, subtype, state, ep, asoc, \ 71 error = sctp_do_sm(event_type, subtype, state, ep, asoc, \
72 arg, GFP_KERNEL); \ 72 arg, GFP_KERNEL); \
73 return error; \ 73 return error; \
74} 74}
75 75
76/* 10.1 ULP-to-SCTP 76/* 10.1 ULP-to-SCTP
@@ -207,7 +207,7 @@ DECLARE_PRIMITIVE(REQUESTHEARTBEAT);
207 207
208/* ADDIP 208/* ADDIP
209* 3.1.1 Address Configuration Change Chunk (ASCONF) 209* 3.1.1 Address Configuration Change Chunk (ASCONF)
210* 210*
211* This chunk is used to communicate to the remote endpoint one of the 211* This chunk is used to communicate to the remote endpoint one of the
212* configuration change requests that MUST be acknowledged. The 212* configuration change requests that MUST be acknowledged. The
213* information carried in the ASCONF Chunk uses the form of a 213* information carried in the ASCONF Chunk uses the form of a
diff --git a/net/sctp/proc.c b/net/sctp/proc.c
index b3493bdbcacb..e93fc1cc430a 100644
--- a/net/sctp/proc.c
+++ b/net/sctp/proc.c
@@ -77,7 +77,7 @@ static struct snmp_mib sctp_snmp_list[] = {
77 77
78/* Return the current value of a particular entry in the mib by adding its 78/* Return the current value of a particular entry in the mib by adding its
79 * per cpu counters. 79 * per cpu counters.
80 */ 80 */
81static unsigned long 81static unsigned long
82fold_field(void *mib[], int nr) 82fold_field(void *mib[], int nr)
83{ 83{
@@ -102,7 +102,7 @@ static int sctp_snmp_seq_show(struct seq_file *seq, void *v)
102 102
103 for (i = 0; sctp_snmp_list[i].name != NULL; i++) 103 for (i = 0; sctp_snmp_list[i].name != NULL; i++)
104 seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name, 104 seq_printf(seq, "%-32s\t%ld\n", sctp_snmp_list[i].name,
105 fold_field((void **)sctp_statistics, 105 fold_field((void **)sctp_statistics,
106 sctp_snmp_list[i].entry)); 106 sctp_snmp_list[i].entry));
107 107
108 return 0; 108 return 0;
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index 0ef48126b117..e17a823ca90f 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -102,11 +102,11 @@ static __init int sctp_proc_init(void)
102 } 102 }
103 103
104 if (sctp_snmp_proc_init()) 104 if (sctp_snmp_proc_init())
105 goto out_nomem; 105 goto out_nomem;
106 if (sctp_eps_proc_init()) 106 if (sctp_eps_proc_init())
107 goto out_nomem; 107 goto out_nomem;
108 if (sctp_assocs_proc_init()) 108 if (sctp_assocs_proc_init())
109 goto out_nomem; 109 goto out_nomem;
110 110
111 return 0; 111 return 0;
112 112
@@ -114,7 +114,7 @@ out_nomem:
114 return -ENOMEM; 114 return -ENOMEM;
115} 115}
116 116
117/* Clean up the proc fs entry for the SCTP protocol. 117/* Clean up the proc fs entry for the SCTP protocol.
118 * Note: Do not make this __exit as it is used in the init error 118 * Note: Do not make this __exit as it is used in the init error
119 * path. 119 * path.
120 */ 120 */
@@ -286,7 +286,7 @@ static int sctp_v4_to_addr_param(const union sctp_addr *addr,
286 286
287 param->v4.param_hdr.type = SCTP_PARAM_IPV4_ADDRESS; 287 param->v4.param_hdr.type = SCTP_PARAM_IPV4_ADDRESS;
288 param->v4.param_hdr.length = htons(length); 288 param->v4.param_hdr.length = htons(length);
289 param->v4.addr.s_addr = addr->v4.sin_addr.s_addr; 289 param->v4.addr.s_addr = addr->v4.sin_addr.s_addr;
290 290
291 return length; 291 return length;
292} 292}
@@ -344,9 +344,9 @@ static int sctp_v4_addr_valid(union sctp_addr *addr,
344 if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr)) 344 if (IS_IPV4_UNUSABLE_ADDRESS(&addr->v4.sin_addr.s_addr))
345 return 0; 345 return 0;
346 346
347 /* Is this a broadcast address? */ 347 /* Is this a broadcast address? */
348 if (skb && ((struct rtable *)skb->dst)->rt_flags & RTCF_BROADCAST) 348 if (skb && ((struct rtable *)skb->dst)->rt_flags & RTCF_BROADCAST)
349 return 0; 349 return 0;
350 350
351 return 1; 351 return 1;
352} 352}
@@ -494,7 +494,7 @@ out_unlock:
494out: 494out:
495 if (dst) 495 if (dst)
496 SCTP_DEBUG_PRINTK("rt_dst:%u.%u.%u.%u, rt_src:%u.%u.%u.%u\n", 496 SCTP_DEBUG_PRINTK("rt_dst:%u.%u.%u.%u, rt_src:%u.%u.%u.%u\n",
497 NIPQUAD(rt->rt_dst), NIPQUAD(rt->rt_src)); 497 NIPQUAD(rt->rt_dst), NIPQUAD(rt->rt_src));
498 else 498 else
499 SCTP_DEBUG_PRINTK("NO ROUTE\n"); 499 SCTP_DEBUG_PRINTK("NO ROUTE\n");
500 500
@@ -517,14 +517,14 @@ static void sctp_v4_get_saddr(struct sctp_association *asoc,
517 if (rt) { 517 if (rt) {
518 saddr->v4.sin_family = AF_INET; 518 saddr->v4.sin_family = AF_INET;
519 saddr->v4.sin_port = htons(asoc->base.bind_addr.port); 519 saddr->v4.sin_port = htons(asoc->base.bind_addr.port);
520 saddr->v4.sin_addr.s_addr = rt->rt_src; 520 saddr->v4.sin_addr.s_addr = rt->rt_src;
521 } 521 }
522} 522}
523 523
524/* What interface did this skb arrive on? */ 524/* What interface did this skb arrive on? */
525static int sctp_v4_skb_iif(const struct sk_buff *skb) 525static int sctp_v4_skb_iif(const struct sk_buff *skb)
526{ 526{
527 return ((struct rtable *)skb->dst)->rt_iif; 527 return ((struct rtable *)skb->dst)->rt_iif;
528} 528}
529 529
530/* Was this packet marked by Explicit Congestion Notification? */ 530/* Was this packet marked by Explicit Congestion Notification? */
@@ -569,7 +569,7 @@ static struct sock *sctp_v4_create_accept_sk(struct sock *sk,
569 newinet->dport = htons(asoc->peer.port); 569 newinet->dport = htons(asoc->peer.port);
570 newinet->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr; 570 newinet->daddr = asoc->peer.primary_addr.v4.sin_addr.s_addr;
571 newinet->pmtudisc = inet->pmtudisc; 571 newinet->pmtudisc = inet->pmtudisc;
572 newinet->id = asoc->next_tsn ^ jiffies; 572 newinet->id = asoc->next_tsn ^ jiffies;
573 573
574 newinet->uc_ttl = -1; 574 newinet->uc_ttl = -1;
575 newinet->mc_loop = 1; 575 newinet->mc_loop = 1;
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 0b1ddb1005ac..b97511655649 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -118,7 +118,7 @@ void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code,
118 int padlen; 118 int padlen;
119 __u16 len; 119 __u16 len;
120 120
121 /* Cause code constants are now defined in network order. */ 121 /* Cause code constants are now defined in network order. */
122 err.cause = cause_code; 122 err.cause = cause_code;
123 len = sizeof(sctp_errhdr_t) + paylen; 123 len = sizeof(sctp_errhdr_t) + paylen;
124 padlen = len % 4; 124 padlen = len % 4;
@@ -295,11 +295,11 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc,
295 */ 295 */
296 chunksize = sizeof(initack) + addrs_len + cookie_len + unkparam_len; 296 chunksize = sizeof(initack) + addrs_len + cookie_len + unkparam_len;
297 297
298 /* Tell peer that we'll do ECN only if peer advertised such cap. */ 298 /* Tell peer that we'll do ECN only if peer advertised such cap. */
299 if (asoc->peer.ecn_capable) 299 if (asoc->peer.ecn_capable)
300 chunksize += sizeof(ecap_param); 300 chunksize += sizeof(ecap_param);
301 301
302 /* Tell peer that we'll do PR-SCTP only if peer advertised. */ 302 /* Tell peer that we'll do PR-SCTP only if peer advertised. */
303 if (asoc->peer.prsctp_capable) 303 if (asoc->peer.prsctp_capable)
304 chunksize += sizeof(prsctp_param); 304 chunksize += sizeof(prsctp_param);
305 305
@@ -728,7 +728,7 @@ struct sctp_chunk *sctp_make_shutdown_complete(
728 if (retval && chunk) 728 if (retval && chunk)
729 retval->transport = chunk->transport; 729 retval->transport = chunk->transport;
730 730
731 return retval; 731 return retval;
732} 732}
733 733
734/* Create an ABORT. Note that we set the T bit if we have no 734/* Create an ABORT. Note that we set the T bit if we have no
@@ -844,7 +844,7 @@ err_chunk:
844 return retval; 844 return retval;
845} 845}
846 846
847/* Make an ABORT chunk with a PROTOCOL VIOLATION cause code. */ 847/* Make an ABORT chunk with a PROTOCOL VIOLATION cause code. */
848struct sctp_chunk *sctp_make_abort_violation( 848struct sctp_chunk *sctp_make_abort_violation(
849 const struct sctp_association *asoc, 849 const struct sctp_association *asoc,
850 const struct sctp_chunk *chunk, 850 const struct sctp_chunk *chunk,
@@ -1265,8 +1265,8 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
1265 /* Header size is static data prior to the actual cookie, including 1265 /* Header size is static data prior to the actual cookie, including
1266 * any padding. 1266 * any padding.
1267 */ 1267 */
1268 headersize = sizeof(sctp_paramhdr_t) + 1268 headersize = sizeof(sctp_paramhdr_t) +
1269 (sizeof(struct sctp_signed_cookie) - 1269 (sizeof(struct sctp_signed_cookie) -
1270 sizeof(struct sctp_cookie)); 1270 sizeof(struct sctp_cookie));
1271 bodysize = sizeof(struct sctp_cookie) 1271 bodysize = sizeof(struct sctp_cookie)
1272 + ntohs(init_chunk->chunk_hdr->length) + addrs_len; 1272 + ntohs(init_chunk->chunk_hdr->length) + addrs_len;
@@ -1315,7 +1315,7 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
1315 memcpy((__u8 *)&cookie->c.peer_init[0] + 1315 memcpy((__u8 *)&cookie->c.peer_init[0] +
1316 ntohs(init_chunk->chunk_hdr->length), raw_addrs, addrs_len); 1316 ntohs(init_chunk->chunk_hdr->length), raw_addrs, addrs_len);
1317 1317
1318 if (sctp_sk(ep->base.sk)->hmac) { 1318 if (sctp_sk(ep->base.sk)->hmac) {
1319 struct hash_desc desc; 1319 struct hash_desc desc;
1320 1320
1321 /* Sign the message. */ 1321 /* Sign the message. */
@@ -1324,8 +1324,8 @@ static sctp_cookie_param_t *sctp_pack_cookie(const struct sctp_endpoint *ep,
1324 sg.length = bodysize; 1324 sg.length = bodysize;
1325 keylen = SCTP_SECRET_SIZE; 1325 keylen = SCTP_SECRET_SIZE;
1326 key = (char *)ep->secret_key[ep->current_key]; 1326 key = (char *)ep->secret_key[ep->current_key];
1327 desc.tfm = sctp_sk(ep->base.sk)->hmac; 1327 desc.tfm = sctp_sk(ep->base.sk)->hmac;
1328 desc.flags = 0; 1328 desc.flags = 0;
1329 1329
1330 if (crypto_hash_setkey(desc.tfm, key, keylen) || 1330 if (crypto_hash_setkey(desc.tfm, key, keylen) ||
1331 crypto_hash_digest(&desc, &sg, bodysize, cookie->signature)) 1331 crypto_hash_digest(&desc, &sg, bodysize, cookie->signature))
@@ -1365,7 +1365,7 @@ struct sctp_association *sctp_unpack_cookie(
1365 * any padding. 1365 * any padding.
1366 */ 1366 */
1367 headersize = sizeof(sctp_chunkhdr_t) + 1367 headersize = sizeof(sctp_chunkhdr_t) +
1368 (sizeof(struct sctp_signed_cookie) - 1368 (sizeof(struct sctp_signed_cookie) -
1369 sizeof(struct sctp_cookie)); 1369 sizeof(struct sctp_cookie));
1370 bodysize = ntohs(chunk->chunk_hdr->length) - headersize; 1370 bodysize = ntohs(chunk->chunk_hdr->length) - headersize;
1371 fixed_size = headersize + sizeof(struct sctp_cookie); 1371 fixed_size = headersize + sizeof(struct sctp_cookie);
@@ -1593,7 +1593,7 @@ static int sctp_process_inv_paramlength(const struct sctp_association *asoc,
1593 struct sctp_chunk **errp) 1593 struct sctp_chunk **errp)
1594{ 1594{
1595 char error[] = "The following parameter had invalid length:"; 1595 char error[] = "The following parameter had invalid length:";
1596 size_t payload_len = WORD_ROUND(sizeof(error)) + 1596 size_t payload_len = WORD_ROUND(sizeof(error)) +
1597 sizeof(sctp_paramhdr_t); 1597 sizeof(sctp_paramhdr_t);
1598 1598
1599 1599
@@ -1752,7 +1752,7 @@ static int sctp_verify_param(const struct sctp_association *asoc,
1752 case SCTP_PARAM_FWD_TSN_SUPPORT: 1752 case SCTP_PARAM_FWD_TSN_SUPPORT:
1753 if (sctp_prsctp_enable) 1753 if (sctp_prsctp_enable)
1754 break; 1754 break;
1755 /* Fall Through */ 1755 /* Fall Through */
1756 default: 1756 default:
1757 SCTP_DEBUG_PRINTK("Unrecognized param: %d for chunk %d.\n", 1757 SCTP_DEBUG_PRINTK("Unrecognized param: %d for chunk %d.\n",
1758 ntohs(param.p->type), cid); 1758 ntohs(param.p->type), cid);
@@ -1861,7 +1861,7 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid,
1861 sctp_walk_params(param, peer_init, init_hdr.params) { 1861 sctp_walk_params(param, peer_init, init_hdr.params) {
1862 1862
1863 if (!sctp_process_param(asoc, param, peer_addr, gfp)) 1863 if (!sctp_process_param(asoc, param, peer_addr, gfp))
1864 goto clean_up; 1864 goto clean_up;
1865 } 1865 }
1866 1866
1867 /* Walk list of transports, removing transports in the UNKNOWN state. */ 1867 /* Walk list of transports, removing transports in the UNKNOWN state. */
@@ -1937,7 +1937,7 @@ int sctp_process_init(struct sctp_association *asoc, sctp_cid_t cid,
1937 */ 1937 */
1938 1938
1939 /* Allocate storage for the negotiated streams if it is not a temporary 1939 /* Allocate storage for the negotiated streams if it is not a temporary
1940 * association. 1940 * association.
1941 */ 1941 */
1942 if (!asoc->temp) { 1942 if (!asoc->temp) {
1943 int assoc_id; 1943 int assoc_id;
@@ -2109,7 +2109,7 @@ static int sctp_process_param(struct sctp_association *asoc,
2109 asoc->peer.prsctp_capable = 1; 2109 asoc->peer.prsctp_capable = 1;
2110 break; 2110 break;
2111 } 2111 }
2112 /* Fall Through */ 2112 /* Fall Through */
2113 default: 2113 default:
2114 /* Any unrecognized parameters should have been caught 2114 /* Any unrecognized parameters should have been caught
2115 * and handled by sctp_verify_param() which should be 2115 * and handled by sctp_verify_param() which should be
@@ -2168,7 +2168,7 @@ __u32 sctp_generate_tsn(const struct sctp_endpoint *ep)
2168 * | ASCONF Parameter #N | 2168 * | ASCONF Parameter #N |
2169 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2169 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2170 * 2170 *
2171 * Address Parameter and other parameter will not be wrapped in this function 2171 * Address Parameter and other parameter will not be wrapped in this function
2172 */ 2172 */
2173static struct sctp_chunk *sctp_make_asconf(struct sctp_association *asoc, 2173static struct sctp_chunk *sctp_make_asconf(struct sctp_association *asoc,
2174 union sctp_addr *addr, 2174 union sctp_addr *addr,
@@ -2290,7 +2290,7 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
2290 * | Address Parameter | 2290 * | Address Parameter |
2291 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2291 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2292 * 2292 *
2293 * Create an ASCONF chunk with Set Primary IP address parameter. 2293 * Create an ASCONF chunk with Set Primary IP address parameter.
2294 */ 2294 */
2295struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc, 2295struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc,
2296 union sctp_addr *addr) 2296 union sctp_addr *addr)
@@ -2339,7 +2339,7 @@ struct sctp_chunk *sctp_make_asconf_set_prim(struct sctp_association *asoc,
2339 * | ASCONF Parameter Response#N | 2339 * | ASCONF Parameter Response#N |
2340 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 2340 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2341 * 2341 *
2342 * Create an ASCONF_ACK chunk with enough space for the parameter responses. 2342 * Create an ASCONF_ACK chunk with enough space for the parameter responses.
2343 */ 2343 */
2344static struct sctp_chunk *sctp_make_asconf_ack(const struct sctp_association *asoc, 2344static struct sctp_chunk *sctp_make_asconf_ack(const struct sctp_association *asoc,
2345 __u32 serial, int vparam_len) 2345 __u32 serial, int vparam_len)
@@ -2381,7 +2381,7 @@ static void sctp_add_asconf_response(struct sctp_chunk *chunk, __be32 crr_id,
2381 ntohs(asconf_param->param_hdr.length); 2381 ntohs(asconf_param->param_hdr.length);
2382 } 2382 }
2383 2383
2384 /* Add Success Indication or Error Cause Indication parameter. */ 2384 /* Add Success Indication or Error Cause Indication parameter. */
2385 ack_param.param_hdr.type = response_type; 2385 ack_param.param_hdr.type = response_type;
2386 ack_param.param_hdr.length = htons(sizeof(ack_param) + 2386 ack_param.param_hdr.length = htons(sizeof(ack_param) +
2387 err_param_len + 2387 err_param_len +
@@ -2424,11 +2424,11 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
2424 switch (asconf_param->param_hdr.type) { 2424 switch (asconf_param->param_hdr.type) {
2425 case SCTP_PARAM_ADD_IP: 2425 case SCTP_PARAM_ADD_IP:
2426 /* ADDIP 4.3 D9) If an endpoint receives an ADD IP address 2426 /* ADDIP 4.3 D9) If an endpoint receives an ADD IP address
2427 * request and does not have the local resources to add this 2427 * request and does not have the local resources to add this
2428 * new address to the association, it MUST return an Error 2428 * new address to the association, it MUST return an Error
2429 * Cause TLV set to the new error code 'Operation Refused 2429 * Cause TLV set to the new error code 'Operation Refused
2430 * Due to Resource Shortage'. 2430 * Due to Resource Shortage'.
2431 */ 2431 */
2432 2432
2433 peer = sctp_assoc_add_peer(asoc, &addr, GFP_ATOMIC, SCTP_UNCONFIRMED); 2433 peer = sctp_assoc_add_peer(asoc, &addr, GFP_ATOMIC, SCTP_UNCONFIRMED);
2434 if (!peer) 2434 if (!peer)
@@ -2440,10 +2440,10 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
2440 break; 2440 break;
2441 case SCTP_PARAM_DEL_IP: 2441 case SCTP_PARAM_DEL_IP:
2442 /* ADDIP 4.3 D7) If a request is received to delete the 2442 /* ADDIP 4.3 D7) If a request is received to delete the
2443 * last remaining IP address of a peer endpoint, the receiver 2443 * last remaining IP address of a peer endpoint, the receiver
2444 * MUST send an Error Cause TLV with the error cause set to the 2444 * MUST send an Error Cause TLV with the error cause set to the
2445 * new error code 'Request to Delete Last Remaining IP Address'. 2445 * new error code 'Request to Delete Last Remaining IP Address'.
2446 */ 2446 */
2447 pos = asoc->peer.transport_addr_list.next; 2447 pos = asoc->peer.transport_addr_list.next;
2448 if (pos->next == &asoc->peer.transport_addr_list) 2448 if (pos->next == &asoc->peer.transport_addr_list)
2449 return SCTP_ERROR_DEL_LAST_IP; 2449 return SCTP_ERROR_DEL_LAST_IP;
@@ -2475,7 +2475,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
2475 return SCTP_ERROR_NO_ERROR; 2475 return SCTP_ERROR_NO_ERROR;
2476} 2476}
2477 2477
2478/* Process an incoming ASCONF chunk with the next expected serial no. and 2478/* Process an incoming ASCONF chunk with the next expected serial no. and
2479 * return an ASCONF_ACK chunk to be sent in response. 2479 * return an ASCONF_ACK chunk to be sent in response.
2480 */ 2480 */
2481struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc, 2481struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
@@ -2495,19 +2495,19 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
2495 hdr = (sctp_addiphdr_t *)asconf->skb->data; 2495 hdr = (sctp_addiphdr_t *)asconf->skb->data;
2496 serial = ntohl(hdr->serial); 2496 serial = ntohl(hdr->serial);
2497 2497
2498 /* Skip the addiphdr and store a pointer to address parameter. */ 2498 /* Skip the addiphdr and store a pointer to address parameter. */
2499 length = sizeof(sctp_addiphdr_t); 2499 length = sizeof(sctp_addiphdr_t);
2500 addr_param = (union sctp_addr_param *)(asconf->skb->data + length); 2500 addr_param = (union sctp_addr_param *)(asconf->skb->data + length);
2501 chunk_len -= length; 2501 chunk_len -= length;
2502 2502
2503 /* Skip the address parameter and store a pointer to the first 2503 /* Skip the address parameter and store a pointer to the first
2504 * asconf paramter. 2504 * asconf paramter.
2505 */ 2505 */
2506 length = ntohs(addr_param->v4.param_hdr.length); 2506 length = ntohs(addr_param->v4.param_hdr.length);
2507 asconf_param = (sctp_addip_param_t *)((void *)addr_param + length); 2507 asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
2508 chunk_len -= length; 2508 chunk_len -= length;
2509 2509
2510 /* create an ASCONF_ACK chunk. 2510 /* create an ASCONF_ACK chunk.
2511 * Based on the definitions of parameters, we know that the size of 2511 * Based on the definitions of parameters, we know that the size of
2512 * ASCONF_ACK parameters are less than or equal to the twice of ASCONF 2512 * ASCONF_ACK parameters are less than or equal to the twice of ASCONF
2513 * paramters. 2513 * paramters.
@@ -2538,7 +2538,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
2538 /* ADDIP 4.3 D11) When an endpoint receiving an ASCONF to add 2538 /* ADDIP 4.3 D11) When an endpoint receiving an ASCONF to add
2539 * an IP address sends an 'Out of Resource' in its response, it 2539 * an IP address sends an 'Out of Resource' in its response, it
2540 * MUST also fail any subsequent add or delete requests bundled 2540 * MUST also fail any subsequent add or delete requests bundled
2541 * in the ASCONF. 2541 * in the ASCONF.
2542 */ 2542 */
2543 if (SCTP_ERROR_RSRC_LOW == err_code) 2543 if (SCTP_ERROR_RSRC_LOW == err_code)
2544 goto done; 2544 goto done;
@@ -2549,12 +2549,12 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
2549 length); 2549 length);
2550 chunk_len -= length; 2550 chunk_len -= length;
2551 } 2551 }
2552 2552
2553done: 2553done:
2554 asoc->peer.addip_serial++; 2554 asoc->peer.addip_serial++;
2555 2555
2556 /* If we are sending a new ASCONF_ACK hold a reference to it in assoc 2556 /* If we are sending a new ASCONF_ACK hold a reference to it in assoc
2557 * after freeing the reference to old asconf ack if any. 2557 * after freeing the reference to old asconf ack if any.
2558 */ 2558 */
2559 if (asconf_ack) { 2559 if (asconf_ack) {
2560 if (asoc->addip_last_asconf_ack) 2560 if (asoc->addip_last_asconf_ack)
@@ -2622,7 +2622,7 @@ static int sctp_asconf_param_success(struct sctp_association *asoc,
2622 2622
2623/* Get the corresponding ASCONF response error code from the ASCONF_ACK chunk 2623/* Get the corresponding ASCONF response error code from the ASCONF_ACK chunk
2624 * for the given asconf parameter. If there is no response for this parameter, 2624 * for the given asconf parameter. If there is no response for this parameter,
2625 * return the error code based on the third argument 'no_err'. 2625 * return the error code based on the third argument 'no_err'.
2626 * ADDIP 4.1 2626 * ADDIP 4.1
2627 * A7) If an error response is received for a TLV parameter, all TLVs with no 2627 * A7) If an error response is received for a TLV parameter, all TLVs with no
2628 * response before the failed TLV are considered successful if not reported. 2628 * response before the failed TLV are considered successful if not reported.
@@ -2646,7 +2646,7 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack,
2646 2646
2647 /* Skip the addiphdr from the asconf_ack chunk and store a pointer to 2647 /* Skip the addiphdr from the asconf_ack chunk and store a pointer to
2648 * the first asconf_ack parameter. 2648 * the first asconf_ack parameter.
2649 */ 2649 */
2650 length = sizeof(sctp_addiphdr_t); 2650 length = sizeof(sctp_addiphdr_t);
2651 asconf_ack_param = (sctp_addip_param_t *)(asconf_ack->skb->data + 2651 asconf_ack_param = (sctp_addip_param_t *)(asconf_ack->skb->data +
2652 length); 2652 length);
@@ -2697,14 +2697,14 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
2697 2697
2698 /* Skip the chunkhdr and addiphdr from the last asconf sent and store 2698 /* Skip the chunkhdr and addiphdr from the last asconf sent and store
2699 * a pointer to address parameter. 2699 * a pointer to address parameter.
2700 */ 2700 */
2701 length = sizeof(sctp_addip_chunk_t); 2701 length = sizeof(sctp_addip_chunk_t);
2702 addr_param = (union sctp_addr_param *)(asconf->skb->data + length); 2702 addr_param = (union sctp_addr_param *)(asconf->skb->data + length);
2703 asconf_len -= length; 2703 asconf_len -= length;
2704 2704
2705 /* Skip the address parameter in the last asconf sent and store a 2705 /* Skip the address parameter in the last asconf sent and store a
2706 * pointer to the first asconf paramter. 2706 * pointer to the first asconf paramter.
2707 */ 2707 */
2708 length = ntohs(addr_param->v4.param_hdr.length); 2708 length = ntohs(addr_param->v4.param_hdr.length);
2709 asconf_param = (sctp_addip_param_t *)((void *)addr_param + length); 2709 asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
2710 asconf_len -= length; 2710 asconf_len -= length;
@@ -2741,7 +2741,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
2741 case SCTP_ERROR_INV_PARAM: 2741 case SCTP_ERROR_INV_PARAM:
2742 /* Disable sending this type of asconf parameter in 2742 /* Disable sending this type of asconf parameter in
2743 * future. 2743 * future.
2744 */ 2744 */
2745 asoc->peer.addip_disabled_mask |= 2745 asoc->peer.addip_disabled_mask |=
2746 asconf_param->param_hdr.type; 2746 asconf_param->param_hdr.type;
2747 break; 2747 break;
@@ -2755,7 +2755,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
2755 2755
2756 /* Skip the processed asconf parameter and move to the next 2756 /* Skip the processed asconf parameter and move to the next
2757 * one. 2757 * one.
2758 */ 2758 */
2759 length = ntohs(asconf_param->param_hdr.length); 2759 length = ntohs(asconf_param->param_hdr.length);
2760 asconf_param = (sctp_addip_param_t *)((void *)asconf_param + 2760 asconf_param = (sctp_addip_param_t *)((void *)asconf_param +
2761 length); 2761 length);
@@ -2784,14 +2784,14 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
2784 return retval; 2784 return retval;
2785} 2785}
2786 2786
2787/* Make a FWD TSN chunk. */ 2787/* Make a FWD TSN chunk. */
2788struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc, 2788struct sctp_chunk *sctp_make_fwdtsn(const struct sctp_association *asoc,
2789 __u32 new_cum_tsn, size_t nstreams, 2789 __u32 new_cum_tsn, size_t nstreams,
2790 struct sctp_fwdtsn_skip *skiplist) 2790 struct sctp_fwdtsn_skip *skiplist)
2791{ 2791{
2792 struct sctp_chunk *retval = NULL; 2792 struct sctp_chunk *retval = NULL;
2793 struct sctp_fwdtsn_chunk *ftsn_chunk; 2793 struct sctp_fwdtsn_chunk *ftsn_chunk;
2794 struct sctp_fwdtsn_hdr ftsn_hdr; 2794 struct sctp_fwdtsn_hdr ftsn_hdr;
2795 struct sctp_fwdtsn_skip skip; 2795 struct sctp_fwdtsn_skip skip;
2796 size_t hint; 2796 size_t hint;
2797 int i; 2797 int i;
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 6db77d1329f7..135567493119 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -61,7 +61,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
61 struct sctp_endpoint *ep, 61 struct sctp_endpoint *ep,
62 struct sctp_association *asoc, 62 struct sctp_association *asoc,
63 void *event_arg, 63 void *event_arg,
64 sctp_disposition_t status, 64 sctp_disposition_t status,
65 sctp_cmd_seq_t *commands, 65 sctp_cmd_seq_t *commands,
66 gfp_t gfp); 66 gfp_t gfp);
67static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype, 67static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
@@ -78,7 +78,7 @@ static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
78 ********************************************************************/ 78 ********************************************************************/
79 79
80/* A helper function for delayed processing of INET ECN CE bit. */ 80/* A helper function for delayed processing of INET ECN CE bit. */
81static void sctp_do_ecn_ce_work(struct sctp_association *asoc, 81static void sctp_do_ecn_ce_work(struct sctp_association *asoc,
82 __u32 lowest_tsn) 82 __u32 lowest_tsn)
83{ 83{
84 /* Save the TSN away for comparison when we receive CWR */ 84 /* Save the TSN away for comparison when we receive CWR */
@@ -160,7 +160,7 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force,
160 struct sctp_transport *trans = asoc->peer.last_data_from; 160 struct sctp_transport *trans = asoc->peer.last_data_from;
161 int error = 0; 161 int error = 0;
162 162
163 if (force || 163 if (force ||
164 (!trans && (asoc->param_flags & SPP_SACKDELAY_DISABLE)) || 164 (!trans && (asoc->param_flags & SPP_SACKDELAY_DISABLE)) ||
165 (trans && (trans->param_flags & SPP_SACKDELAY_DISABLE))) 165 (trans && (trans->param_flags & SPP_SACKDELAY_DISABLE)))
166 asoc->peer.sack_needed = 1; 166 asoc->peer.sack_needed = 1;
@@ -178,7 +178,7 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force,
178 * [This is actually not mentioned in Section 6, but we 178 * [This is actually not mentioned in Section 6, but we
179 * implement it here anyway. --piggy] 179 * implement it here anyway. --piggy]
180 */ 180 */
181 if (max_tsn_seen != ctsn) 181 if (max_tsn_seen != ctsn)
182 asoc->peer.sack_needed = 1; 182 asoc->peer.sack_needed = 1;
183 183
184 /* From 6.2 Acknowledgement on Reception of DATA Chunks: 184 /* From 6.2 Acknowledgement on Reception of DATA Chunks:
@@ -199,10 +199,10 @@ static int sctp_gen_sack(struct sctp_association *asoc, int force,
199 * for the association. 199 * for the association.
200 */ 200 */
201 if (trans) 201 if (trans)
202 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = 202 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] =
203 trans->sackdelay; 203 trans->sackdelay;
204 else 204 else
205 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] = 205 asoc->timeouts[SCTP_EVENT_TIMEOUT_SACK] =
206 asoc->sackdelay; 206 asoc->sackdelay;
207 207
208 /* Restart the SACK timer. */ 208 /* Restart the SACK timer. */
@@ -338,8 +338,8 @@ static void sctp_generate_t4_rto_event(unsigned long data)
338 338
339static void sctp_generate_t5_shutdown_guard_event(unsigned long data) 339static void sctp_generate_t5_shutdown_guard_event(unsigned long data)
340{ 340{
341 struct sctp_association *asoc = (struct sctp_association *)data; 341 struct sctp_association *asoc = (struct sctp_association *)data;
342 sctp_generate_timeout_event(asoc, 342 sctp_generate_timeout_event(asoc,
343 SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD); 343 SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD);
344 344
345} /* sctp_generate_t5_shutdown_guard_event() */ 345} /* sctp_generate_t5_shutdown_guard_event() */
@@ -380,7 +380,7 @@ void sctp_generate_heartbeat_event(unsigned long data)
380 asoc->state, asoc->ep, asoc, 380 asoc->state, asoc->ep, asoc,
381 transport, GFP_ATOMIC); 381 transport, GFP_ATOMIC);
382 382
383 if (error) 383 if (error)
384 asoc->base.sk->sk_err = -error; 384 asoc->base.sk->sk_err = -error;
385 385
386out_unlock: 386out_unlock:
@@ -570,7 +570,7 @@ static void sctp_cmd_hb_timers_stop(sctp_cmd_seq_t *cmds,
570 570
571/* Helper function to stop any pending T3-RTX timers */ 571/* Helper function to stop any pending T3-RTX timers */
572static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds, 572static void sctp_cmd_t3_rtx_timers_stop(sctp_cmd_seq_t *cmds,
573 struct sctp_association *asoc) 573 struct sctp_association *asoc)
574{ 574{
575 struct sctp_transport *t; 575 struct sctp_transport *t;
576 struct list_head *pos; 576 struct list_head *pos;
@@ -675,7 +675,7 @@ static int sctp_cmd_process_sack(sctp_cmd_seq_t *cmds,
675/* Helper function to set the timeout value for T2-SHUTDOWN timer and to set 675/* Helper function to set the timeout value for T2-SHUTDOWN timer and to set
676 * the transport for a shutdown chunk. 676 * the transport for a shutdown chunk.
677 */ 677 */
678static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds, 678static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds,
679 struct sctp_association *asoc, 679 struct sctp_association *asoc,
680 struct sctp_chunk *chunk) 680 struct sctp_chunk *chunk)
681{ 681{
@@ -688,7 +688,7 @@ static void sctp_cmd_setup_t2(sctp_cmd_seq_t *cmds,
688} 688}
689 689
690/* Helper function to change the state of an association. */ 690/* Helper function to change the state of an association. */
691static void sctp_cmd_new_state(sctp_cmd_seq_t *cmds, 691static void sctp_cmd_new_state(sctp_cmd_seq_t *cmds,
692 struct sctp_association *asoc, 692 struct sctp_association *asoc,
693 sctp_state_t state) 693 sctp_state_t state)
694{ 694{
@@ -727,7 +727,7 @@ static void sctp_cmd_new_state(sctp_cmd_seq_t *cmds,
727 sctp_state(asoc, SHUTDOWN_RECEIVED)) { 727 sctp_state(asoc, SHUTDOWN_RECEIVED)) {
728 /* Wake up any processes waiting in the asoc's wait queue in 728 /* Wake up any processes waiting in the asoc's wait queue in
729 * sctp_wait_for_connect() or sctp_wait_for_sndbuf(). 729 * sctp_wait_for_connect() or sctp_wait_for_sndbuf().
730 */ 730 */
731 if (waitqueue_active(&asoc->wait)) 731 if (waitqueue_active(&asoc->wait))
732 wake_up_interruptible(&asoc->wait); 732 wake_up_interruptible(&asoc->wait);
733 733
@@ -749,9 +749,9 @@ static void sctp_cmd_delete_tcb(sctp_cmd_seq_t *cmds,
749 struct sock *sk = asoc->base.sk; 749 struct sock *sk = asoc->base.sk;
750 750
751 /* If it is a non-temporary association belonging to a TCP-style 751 /* If it is a non-temporary association belonging to a TCP-style
752 * listening socket that is not closed, do not free it so that accept() 752 * listening socket that is not closed, do not free it so that accept()
753 * can pick it up later. 753 * can pick it up later.
754 */ 754 */
755 if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING) && 755 if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING) &&
756 (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK)) 756 (!asoc->temp) && (sk->sk_shutdown != SHUTDOWN_MASK))
757 return; 757 return;
@@ -764,7 +764,7 @@ static void sctp_cmd_delete_tcb(sctp_cmd_seq_t *cmds,
764 * ADDIP Section 4.1 ASCONF Chunk Procedures 764 * ADDIP Section 4.1 ASCONF Chunk Procedures
765 * A4) Start a T-4 RTO timer, using the RTO value of the selected 765 * A4) Start a T-4 RTO timer, using the RTO value of the selected
766 * destination address (we use active path instead of primary path just 766 * destination address (we use active path instead of primary path just
767 * because primary path may be inactive. 767 * because primary path may be inactive.
768 */ 768 */
769static void sctp_cmd_setup_t4(sctp_cmd_seq_t *cmds, 769static void sctp_cmd_setup_t4(sctp_cmd_seq_t *cmds,
770 struct sctp_association *asoc, 770 struct sctp_association *asoc,
@@ -777,7 +777,7 @@ static void sctp_cmd_setup_t4(sctp_cmd_seq_t *cmds,
777 chunk->transport = t; 777 chunk->transport = t;
778} 778}
779 779
780/* Process an incoming Operation Error Chunk. */ 780/* Process an incoming Operation Error Chunk. */
781static void sctp_cmd_process_operr(sctp_cmd_seq_t *cmds, 781static void sctp_cmd_process_operr(sctp_cmd_seq_t *cmds,
782 struct sctp_association *asoc, 782 struct sctp_association *asoc,
783 struct sctp_chunk *chunk) 783 struct sctp_chunk *chunk)
@@ -816,7 +816,7 @@ static void sctp_cmd_process_operr(sctp_cmd_seq_t *cmds,
816} 816}
817 817
818/* Process variable FWDTSN chunk information. */ 818/* Process variable FWDTSN chunk information. */
819static void sctp_cmd_process_fwdtsn(struct sctp_ulpq *ulpq, 819static void sctp_cmd_process_fwdtsn(struct sctp_ulpq *ulpq,
820 struct sctp_chunk *chunk) 820 struct sctp_chunk *chunk)
821{ 821{
822 struct sctp_fwdtsn_skip *skip; 822 struct sctp_fwdtsn_skip *skip;
@@ -828,9 +828,9 @@ static void sctp_cmd_process_fwdtsn(struct sctp_ulpq *ulpq,
828 return; 828 return;
829} 829}
830 830
831/* Helper function to remove the association non-primary peer 831/* Helper function to remove the association non-primary peer
832 * transports. 832 * transports.
833 */ 833 */
834static void sctp_cmd_del_non_primary(struct sctp_association *asoc) 834static void sctp_cmd_del_non_primary(struct sctp_association *asoc)
835{ 835{
836 struct sctp_transport *t; 836 struct sctp_transport *t;
@@ -840,7 +840,7 @@ static void sctp_cmd_del_non_primary(struct sctp_association *asoc)
840 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) { 840 list_for_each_safe(pos, temp, &asoc->peer.transport_addr_list) {
841 t = list_entry(pos, struct sctp_transport, transports); 841 t = list_entry(pos, struct sctp_transport, transports);
842 if (!sctp_cmp_addr_exact(&t->ipaddr, 842 if (!sctp_cmp_addr_exact(&t->ipaddr,
843 &asoc->peer.primary_addr)) { 843 &asoc->peer.primary_addr)) {
844 sctp_assoc_del_peer(asoc, &t->ipaddr); 844 sctp_assoc_del_peer(asoc, &t->ipaddr);
845 } 845 }
846 } 846 }
@@ -915,7 +915,7 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype,
915 DEBUG_POST; 915 DEBUG_POST;
916 916
917 error = sctp_side_effects(event_type, subtype, state, 917 error = sctp_side_effects(event_type, subtype, state,
918 ep, asoc, event_arg, status, 918 ep, asoc, event_arg, status,
919 &commands, gfp); 919 &commands, gfp);
920 DEBUG_POST_SFX; 920 DEBUG_POST_SFX;
921 921
@@ -968,7 +968,7 @@ static int sctp_side_effects(sctp_event_t event_type, sctp_subtype_t subtype,
968 error = -ENOMEM; 968 error = -ENOMEM;
969 break; 969 break;
970 970
971 case SCTP_DISPOSITION_DELETE_TCB: 971 case SCTP_DISPOSITION_DELETE_TCB:
972 /* This should now be a command. */ 972 /* This should now be a command. */
973 break; 973 break;
974 974
@@ -1021,7 +1021,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1021 struct sctp_endpoint *ep, 1021 struct sctp_endpoint *ep,
1022 struct sctp_association *asoc, 1022 struct sctp_association *asoc,
1023 void *event_arg, 1023 void *event_arg,
1024 sctp_disposition_t status, 1024 sctp_disposition_t status,
1025 sctp_cmd_seq_t *commands, 1025 sctp_cmd_seq_t *commands,
1026 gfp_t gfp) 1026 gfp_t gfp)
1027{ 1027{
@@ -1057,7 +1057,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1057 case SCTP_CMD_NEW_ASOC: 1057 case SCTP_CMD_NEW_ASOC:
1058 /* Register a new association. */ 1058 /* Register a new association. */
1059 if (local_cork) { 1059 if (local_cork) {
1060 sctp_outq_uncork(&asoc->outqueue); 1060 sctp_outq_uncork(&asoc->outqueue);
1061 local_cork = 0; 1061 local_cork = 0;
1062 } 1062 }
1063 asoc = cmd->obj.ptr; 1063 asoc = cmd->obj.ptr;
@@ -1074,7 +1074,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1074 sctp_outq_teardown(&asoc->outqueue); 1074 sctp_outq_teardown(&asoc->outqueue);
1075 break; 1075 break;
1076 1076
1077 case SCTP_CMD_DELETE_TCB: 1077 case SCTP_CMD_DELETE_TCB:
1078 if (local_cork) { 1078 if (local_cork) {
1079 sctp_outq_uncork(&asoc->outqueue); 1079 sctp_outq_uncork(&asoc->outqueue);
1080 local_cork = 0; 1080 local_cork = 0;
@@ -1104,7 +1104,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1104 1104
1105 case SCTP_CMD_PROCESS_FWDTSN: 1105 case SCTP_CMD_PROCESS_FWDTSN:
1106 sctp_cmd_process_fwdtsn(&asoc->ulpq, cmd->obj.ptr); 1106 sctp_cmd_process_fwdtsn(&asoc->ulpq, cmd->obj.ptr);
1107 break; 1107 break;
1108 1108
1109 case SCTP_CMD_GEN_SACK: 1109 case SCTP_CMD_GEN_SACK:
1110 /* Generate a Selective ACK. 1110 /* Generate a Selective ACK.
@@ -1162,12 +1162,12 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1162 SCTP_CHUNK(cmd->obj.ptr)); 1162 SCTP_CHUNK(cmd->obj.ptr));
1163 1163
1164 /* FIXME - Eventually come up with a cleaner way to 1164 /* FIXME - Eventually come up with a cleaner way to
1165 * enabling COOKIE-ECHO + DATA bundling during 1165 * enabling COOKIE-ECHO + DATA bundling during
1166 * multihoming stale cookie scenarios, the following 1166 * multihoming stale cookie scenarios, the following
1167 * command plays with asoc->peer.retran_path to 1167 * command plays with asoc->peer.retran_path to
1168 * avoid the problem of sending the COOKIE-ECHO and 1168 * avoid the problem of sending the COOKIE-ECHO and
1169 * DATA in different paths, which could result 1169 * DATA in different paths, which could result
1170 * in the association being ABORTed if the DATA chunk 1170 * in the association being ABORTed if the DATA chunk
1171 * is processed first by the server. Checking the 1171 * is processed first by the server. Checking the
1172 * init error counter simply causes this command 1172 * init error counter simply causes this command
1173 * to be executed only during failed attempts of 1173 * to be executed only during failed attempts of
@@ -1177,7 +1177,7 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
1177 asoc->peer.primary_path) && 1177 asoc->peer.primary_path) &&
1178 (asoc->init_err_counter > 0)) { 1178 (asoc->init_err_counter > 0)) {
1179 sctp_add_cmd_sf(commands, 1179 sctp_add_cmd_sf(commands,
1180 SCTP_CMD_FORCE_PRIM_RETRAN, 1180 SCTP_CMD_FORCE_PRIM_RETRAN,
1181 SCTP_NULL()); 1181 SCTP_NULL());
1182 } 1182 }
1183 1183
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index fbbc9e6a3b78..b3cad8a03736 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -189,7 +189,7 @@ sctp_disposition_t sctp_sf_do_4_C(const struct sctp_endpoint *ep,
189 0, 0, 0, GFP_ATOMIC); 189 0, 0, 0, GFP_ATOMIC);
190 if (ev) 190 if (ev)
191 sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, 191 sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP,
192 SCTP_ULPEVENT(ev)); 192 SCTP_ULPEVENT(ev));
193 193
194 /* Upon reception of the SHUTDOWN COMPLETE chunk the endpoint 194 /* Upon reception of the SHUTDOWN COMPLETE chunk the endpoint
195 * will verify that it is in SHUTDOWN-ACK-SENT state, if it is 195 * will verify that it is in SHUTDOWN-ACK-SENT state, if it is
@@ -228,7 +228,7 @@ sctp_disposition_t sctp_sf_do_4_C(const struct sctp_endpoint *ep,
228 * Verification Tag field to Tag_A, and also provide its own 228 * Verification Tag field to Tag_A, and also provide its own
229 * Verification Tag (Tag_Z) in the Initiate Tag field. 229 * Verification Tag (Tag_Z) in the Initiate Tag field.
230 * 230 *
231 * Verification Tag: Must be 0. 231 * Verification Tag: Must be 0.
232 * 232 *
233 * Inputs 233 * Inputs
234 * (endpoint, asoc, chunk) 234 * (endpoint, asoc, chunk)
@@ -256,7 +256,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
256 /* 6.10 Bundling 256 /* 6.10 Bundling
257 * An endpoint MUST NOT bundle INIT, INIT ACK or 257 * An endpoint MUST NOT bundle INIT, INIT ACK or
258 * SHUTDOWN COMPLETE with any other chunks. 258 * SHUTDOWN COMPLETE with any other chunks.
259 * 259 *
260 * IG Section 2.11.2 260 * IG Section 2.11.2
261 * Furthermore, we require that the receiver of an INIT chunk MUST 261 * Furthermore, we require that the receiver of an INIT chunk MUST
262 * enforce these rules by silently discarding an arriving packet 262 * enforce these rules by silently discarding an arriving packet
@@ -282,7 +282,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
282 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); 282 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
283 283
284 /* 3.1 A packet containing an INIT chunk MUST have a zero Verification 284 /* 3.1 A packet containing an INIT chunk MUST have a zero Verification
285 * Tag. 285 * Tag.
286 */ 286 */
287 if (chunk->sctp_hdr->vtag != 0) 287 if (chunk->sctp_hdr->vtag != 0)
288 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); 288 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
@@ -326,7 +326,7 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
326 } 326 }
327 } 327 }
328 328
329 /* Grab the INIT header. */ 329 /* Grab the INIT header. */
330 chunk->subh.init_hdr = (sctp_inithdr_t *)chunk->skb->data; 330 chunk->subh.init_hdr = (sctp_inithdr_t *)chunk->skb->data;
331 331
332 /* Tag the variable length parameters. */ 332 /* Tag the variable length parameters. */
@@ -594,7 +594,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
594 /* "Decode" the chunk. We have no optional parameters so we 594 /* "Decode" the chunk. We have no optional parameters so we
595 * are in good shape. 595 * are in good shape.
596 */ 596 */
597 chunk->subh.cookie_hdr = 597 chunk->subh.cookie_hdr =
598 (struct sctp_signed_cookie *)chunk->skb->data; 598 (struct sctp_signed_cookie *)chunk->skb->data;
599 if (!pskb_pull(chunk->skb, ntohs(chunk->chunk_hdr->length) - 599 if (!pskb_pull(chunk->skb, ntohs(chunk->chunk_hdr->length) -
600 sizeof(sctp_chunkhdr_t))) 600 sizeof(sctp_chunkhdr_t)))
@@ -665,7 +665,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
665 if (!ev) 665 if (!ev)
666 goto nomem_ev; 666 goto nomem_ev;
667 667
668 /* Sockets API Draft Section 5.3.1.6 668 /* Sockets API Draft Section 5.3.1.6
669 * When a peer sends a Adaptation Layer Indication parameter , SCTP 669 * When a peer sends a Adaptation Layer Indication parameter , SCTP
670 * delivers this notification to inform the application that of the 670 * delivers this notification to inform the application that of the
671 * peers requested adaptation layer. 671 * peers requested adaptation layer.
@@ -891,7 +891,7 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep,
891 sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMER_UPDATE, 891 sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMER_UPDATE,
892 SCTP_TRANSPORT(transport)); 892 SCTP_TRANSPORT(transport));
893 893
894 return SCTP_DISPOSITION_CONSUME; 894 return SCTP_DISPOSITION_CONSUME;
895} 895}
896 896
897/* 897/*
@@ -1280,7 +1280,7 @@ static sctp_disposition_t sctp_sf_do_unexpected_init(
1280 return sctp_sf_pdiscard(ep, asoc, type, arg, commands); 1280 return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
1281 1281
1282 /* 3.1 A packet containing an INIT chunk MUST have a zero Verification 1282 /* 3.1 A packet containing an INIT chunk MUST have a zero Verification
1283 * Tag. 1283 * Tag.
1284 */ 1284 */
1285 if (chunk->sctp_hdr->vtag != 0) 1285 if (chunk->sctp_hdr->vtag != 0)
1286 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); 1286 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
@@ -1548,7 +1548,7 @@ sctp_disposition_t sctp_sf_do_5_2_3_initack(const struct sctp_endpoint *ep,
1548 /* Per the above section, we'll discard the chunk if we have an 1548 /* Per the above section, we'll discard the chunk if we have an
1549 * endpoint. If this is an OOTB INIT-ACK, treat it as such. 1549 * endpoint. If this is an OOTB INIT-ACK, treat it as such.
1550 */ 1550 */
1551 if (ep == sctp_sk((sctp_get_ctl_sock()))->ep) 1551 if (ep == sctp_sk((sctp_get_ctl_sock()))->ep)
1552 return sctp_sf_ootb(ep, asoc, type, arg, commands); 1552 return sctp_sf_ootb(ep, asoc, type, arg, commands);
1553 else 1553 else
1554 return sctp_sf_discard_chunk(ep, asoc, type, arg, commands); 1554 return sctp_sf_discard_chunk(ep, asoc, type, arg, commands);
@@ -1760,9 +1760,9 @@ static sctp_disposition_t sctp_sf_do_dupcook_d(const struct sctp_endpoint *ep,
1760 1760
1761 /* Clarification from Implementor's Guide: 1761 /* Clarification from Implementor's Guide:
1762 * D) When both local and remote tags match the endpoint should 1762 * D) When both local and remote tags match the endpoint should
1763 * enter the ESTABLISHED state, if it is in the COOKIE-ECHOED state. 1763 * enter the ESTABLISHED state, if it is in the COOKIE-ECHOED state.
1764 * It should stop any cookie timer that may be running and send 1764 * It should stop any cookie timer that may be running and send
1765 * a COOKIE ACK. 1765 * a COOKIE ACK.
1766 */ 1766 */
1767 1767
1768 /* Don't accidentally move back into established state. */ 1768 /* Don't accidentally move back into established state. */
@@ -1786,7 +1786,7 @@ static sctp_disposition_t sctp_sf_do_dupcook_d(const struct sctp_endpoint *ep,
1786 SCTP_COMM_UP, 0, 1786 SCTP_COMM_UP, 0,
1787 asoc->c.sinit_num_ostreams, 1787 asoc->c.sinit_num_ostreams,
1788 asoc->c.sinit_max_instreams, 1788 asoc->c.sinit_max_instreams,
1789 GFP_ATOMIC); 1789 GFP_ATOMIC);
1790 if (!ev) 1790 if (!ev)
1791 goto nomem; 1791 goto nomem;
1792 1792
@@ -1870,7 +1870,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep,
1870 /* "Decode" the chunk. We have no optional parameters so we 1870 /* "Decode" the chunk. We have no optional parameters so we
1871 * are in good shape. 1871 * are in good shape.
1872 */ 1872 */
1873 chunk->subh.cookie_hdr = (struct sctp_signed_cookie *)chunk->skb->data; 1873 chunk->subh.cookie_hdr = (struct sctp_signed_cookie *)chunk->skb->data;
1874 if (!pskb_pull(chunk->skb, ntohs(chunk->chunk_hdr->length) - 1874 if (!pskb_pull(chunk->skb, ntohs(chunk->chunk_hdr->length) -
1875 sizeof(sctp_chunkhdr_t))) 1875 sizeof(sctp_chunkhdr_t)))
1876 goto nomem; 1876 goto nomem;
@@ -1936,7 +1936,7 @@ sctp_disposition_t sctp_sf_do_5_2_4_dupcook(const struct sctp_endpoint *ep,
1936 default: /* Discard packet for all others. */ 1936 default: /* Discard packet for all others. */
1937 retval = sctp_sf_pdiscard(ep, asoc, type, arg, commands); 1937 retval = sctp_sf_pdiscard(ep, asoc, type, arg, commands);
1938 break; 1938 break;
1939 }; 1939 };
1940 1940
1941 /* Delete the tempory new association. */ 1941 /* Delete the tempory new association. */
1942 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc)); 1942 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_ASOC, SCTP_ASOC(new_asoc));
@@ -2083,7 +2083,7 @@ sctp_disposition_t sctp_sf_cookie_echoed_err(const struct sctp_endpoint *ep,
2083 */ 2083 */
2084 sctp_walk_errors(err, chunk->chunk_hdr) { 2084 sctp_walk_errors(err, chunk->chunk_hdr) {
2085 if (SCTP_ERROR_STALE_COOKIE == err->cause) 2085 if (SCTP_ERROR_STALE_COOKIE == err->cause)
2086 return sctp_sf_do_5_2_6_stale(ep, asoc, type, 2086 return sctp_sf_do_5_2_6_stale(ep, asoc, type,
2087 arg, commands); 2087 arg, commands);
2088 } 2088 }
2089 2089
@@ -2185,10 +2185,10 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep,
2185 */ 2185 */
2186 sctp_add_cmd_sf(commands, SCTP_CMD_DEL_NON_PRIMARY, SCTP_NULL()); 2186 sctp_add_cmd_sf(commands, SCTP_CMD_DEL_NON_PRIMARY, SCTP_NULL());
2187 2187
2188 /* If we've sent any data bundled with COOKIE-ECHO we will need to 2188 /* If we've sent any data bundled with COOKIE-ECHO we will need to
2189 * resend 2189 * resend
2190 */ 2190 */
2191 sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN, 2191 sctp_add_cmd_sf(commands, SCTP_CMD_RETRAN,
2192 SCTP_TRANSPORT(asoc->peer.primary_path)); 2192 SCTP_TRANSPORT(asoc->peer.primary_path));
2193 2193
2194 /* Cast away the const modifier, as we want to just 2194 /* Cast away the const modifier, as we want to just
@@ -2274,7 +2274,7 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep,
2274 error = ((sctp_errhdr_t *)chunk->skb->data)->cause; 2274 error = ((sctp_errhdr_t *)chunk->skb->data)->cause;
2275 2275
2276 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(ECONNRESET)); 2276 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(ECONNRESET));
2277 /* ASSOC_FAILED will DELETE_TCB. */ 2277 /* ASSOC_FAILED will DELETE_TCB. */
2278 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_PERR(error)); 2278 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_PERR(error));
2279 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 2279 SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
2280 SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); 2280 SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
@@ -2439,7 +2439,7 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown(const struct sctp_endpoint *ep,
2439 ev = sctp_ulpevent_make_shutdown_event(asoc, 0, GFP_ATOMIC); 2439 ev = sctp_ulpevent_make_shutdown_event(asoc, 0, GFP_ATOMIC);
2440 if (!ev) { 2440 if (!ev) {
2441 disposition = SCTP_DISPOSITION_NOMEM; 2441 disposition = SCTP_DISPOSITION_NOMEM;
2442 goto out; 2442 goto out;
2443 } 2443 }
2444 sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev)); 2444 sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev));
2445 2445
@@ -2553,7 +2553,7 @@ sctp_disposition_t sctp_sf_do_ecn_cwr(const struct sctp_endpoint *ep,
2553 if (!sctp_chunk_length_valid(chunk, sizeof(sctp_ecne_chunk_t))) 2553 if (!sctp_chunk_length_valid(chunk, sizeof(sctp_ecne_chunk_t)))
2554 return sctp_sf_violation_chunklen(ep, asoc, type, arg, 2554 return sctp_sf_violation_chunklen(ep, asoc, type, arg,
2555 commands); 2555 commands);
2556 2556
2557 cwr = (sctp_cwrhdr_t *) chunk->skb->data; 2557 cwr = (sctp_cwrhdr_t *) chunk->skb->data;
2558 skb_pull(chunk->skb, sizeof(sctp_cwrhdr_t)); 2558 skb_pull(chunk->skb, sizeof(sctp_cwrhdr_t));
2559 2559
@@ -2661,7 +2661,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(const struct sctp_endpoint *ep,
2661 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG, 2661 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_BAD_TAG,
2662 SCTP_NULL()); 2662 SCTP_NULL());
2663 return sctp_sf_pdiscard(ep, asoc, type, arg, commands); 2663 return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
2664 } 2664 }
2665 2665
2666 if (!sctp_chunk_length_valid(chunk, sizeof(sctp_data_chunk_t))) 2666 if (!sctp_chunk_length_valid(chunk, sizeof(sctp_data_chunk_t)))
2667 return sctp_sf_violation_chunklen(ep, asoc, type, arg, 2667 return sctp_sf_violation_chunklen(ep, asoc, type, arg,
@@ -2743,7 +2743,7 @@ discard_noforce:
2743 return SCTP_DISPOSITION_DISCARD; 2743 return SCTP_DISPOSITION_DISCARD;
2744consume: 2744consume:
2745 return SCTP_DISPOSITION_CONSUME; 2745 return SCTP_DISPOSITION_CONSUME;
2746 2746
2747} 2747}
2748 2748
2749/* 2749/*
@@ -2930,7 +2930,7 @@ sctp_disposition_t sctp_sf_tabort_8_4_8(const struct sctp_endpoint *ep,
2930 /* Make an ABORT. The T bit will be set if the asoc 2930 /* Make an ABORT. The T bit will be set if the asoc
2931 * is NULL. 2931 * is NULL.
2932 */ 2932 */
2933 abort = sctp_make_abort(asoc, chunk, 0); 2933 abort = sctp_make_abort(asoc, chunk, 0);
2934 if (!abort) { 2934 if (!abort) {
2935 sctp_ootb_pkt_free(packet); 2935 sctp_ootb_pkt_free(packet);
2936 return SCTP_DISPOSITION_NOMEM; 2936 return SCTP_DISPOSITION_NOMEM;
@@ -2994,7 +2994,7 @@ sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep,
2994 } 2994 }
2995 2995
2996 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR, 2996 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR,
2997 SCTP_CHUNK(chunk)); 2997 SCTP_CHUNK(chunk));
2998 } 2998 }
2999 return SCTP_DISPOSITION_CONSUME; 2999 return SCTP_DISPOSITION_CONSUME;
3000 3000
@@ -3128,7 +3128,7 @@ sctp_disposition_t sctp_sf_ootb(const struct sctp_endpoint *ep,
3128 */ 3128 */
3129 if (SCTP_CID_ABORT == ch->type) 3129 if (SCTP_CID_ABORT == ch->type)
3130 return sctp_sf_pdiscard(ep, asoc, type, arg, commands); 3130 return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
3131 3131
3132 ch = (sctp_chunkhdr_t *) ch_end; 3132 ch = (sctp_chunkhdr_t *) ch_end;
3133 } while (ch_end < skb->tail); 3133 } while (ch_end < skb->tail);
3134 3134
@@ -3175,8 +3175,8 @@ static sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep,
3175 3175
3176 if (packet) { 3176 if (packet) {
3177 /* Make an SHUTDOWN_COMPLETE. 3177 /* Make an SHUTDOWN_COMPLETE.
3178 * The T bit will be set if the asoc is NULL. 3178 * The T bit will be set if the asoc is NULL.
3179 */ 3179 */
3180 shut = sctp_make_shutdown_complete(asoc, chunk); 3180 shut = sctp_make_shutdown_complete(asoc, chunk);
3181 if (!shut) { 3181 if (!shut) {
3182 sctp_ootb_pkt_free(packet); 3182 sctp_ootb_pkt_free(packet);
@@ -3261,10 +3261,10 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep,
3261 3261
3262 /* ADDIP 4.2 C1) Compare the value of the serial number to the value 3262 /* ADDIP 4.2 C1) Compare the value of the serial number to the value
3263 * the endpoint stored in a new association variable 3263 * the endpoint stored in a new association variable
3264 * 'Peer-Serial-Number'. 3264 * 'Peer-Serial-Number'.
3265 */ 3265 */
3266 if (serial == asoc->peer.addip_serial + 1) { 3266 if (serial == asoc->peer.addip_serial + 1) {
3267 /* ADDIP 4.2 C2) If the value found in the serial number is 3267 /* ADDIP 4.2 C2) If the value found in the serial number is
3268 * equal to the ('Peer-Serial-Number' + 1), the endpoint MUST 3268 * equal to the ('Peer-Serial-Number' + 1), the endpoint MUST
3269 * do V1-V5. 3269 * do V1-V5.
3270 */ 3270 */
@@ -3285,9 +3285,9 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep,
3285 else 3285 else
3286 return SCTP_DISPOSITION_DISCARD; 3286 return SCTP_DISPOSITION_DISCARD;
3287 } else { 3287 } else {
3288 /* ADDIP 4.2 C4) Otherwise, the ASCONF Chunk is discarded since 3288 /* ADDIP 4.2 C4) Otherwise, the ASCONF Chunk is discarded since
3289 * it must be either a stale packet or from an attacker. 3289 * it must be either a stale packet or from an attacker.
3290 */ 3290 */
3291 return SCTP_DISPOSITION_DISCARD; 3291 return SCTP_DISPOSITION_DISCARD;
3292 } 3292 }
3293 3293
@@ -3296,7 +3296,7 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep,
3296 * being responded to. 3296 * being responded to.
3297 */ 3297 */
3298 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(asconf_ack)); 3298 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(asconf_ack));
3299 3299
3300 return SCTP_DISPOSITION_CONSUME; 3300 return SCTP_DISPOSITION_CONSUME;
3301} 3301}
3302 3302
@@ -3307,7 +3307,7 @@ sctp_disposition_t sctp_sf_do_asconf(const struct sctp_endpoint *ep,
3307 */ 3307 */
3308sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep, 3308sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
3309 const struct sctp_association *asoc, 3309 const struct sctp_association *asoc,
3310 const sctp_subtype_t type, void *arg, 3310 const sctp_subtype_t type, void *arg,
3311 sctp_cmd_seq_t *commands) 3311 sctp_cmd_seq_t *commands)
3312{ 3312{
3313 struct sctp_chunk *asconf_ack = arg; 3313 struct sctp_chunk *asconf_ack = arg;
@@ -3359,7 +3359,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
3359 SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); 3359 SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
3360 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); 3360 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
3361 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, 3361 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
3362 SCTP_ERROR(ECONNABORTED)); 3362 SCTP_ERROR(ECONNABORTED));
3363 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 3363 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
3364 SCTP_PERR(SCTP_ERROR_ASCONF_ACK)); 3364 SCTP_PERR(SCTP_ERROR_ASCONF_ACK));
3365 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 3365 SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
@@ -3387,7 +3387,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
3387 */ 3387 */
3388 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); 3388 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL());
3389 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, 3389 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
3390 SCTP_ERROR(ECONNABORTED)); 3390 SCTP_ERROR(ECONNABORTED));
3391 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 3391 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
3392 SCTP_PERR(SCTP_ERROR_ASCONF_ACK)); 3392 SCTP_PERR(SCTP_ERROR_ASCONF_ACK));
3393 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 3393 SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
@@ -3451,17 +3451,17 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(const struct sctp_endpoint *ep,
3451 3451
3452 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_FWDTSN, SCTP_U32(tsn)); 3452 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_FWDTSN, SCTP_U32(tsn));
3453 if (len > sizeof(struct sctp_fwdtsn_hdr)) 3453 if (len > sizeof(struct sctp_fwdtsn_hdr))
3454 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_FWDTSN, 3454 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_FWDTSN,
3455 SCTP_CHUNK(chunk)); 3455 SCTP_CHUNK(chunk));
3456 3456
3457 /* Count this as receiving DATA. */ 3457 /* Count this as receiving DATA. */
3458 if (asoc->autoclose) { 3458 if (asoc->autoclose) {
3459 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, 3459 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
3460 SCTP_TO(SCTP_EVENT_TIMEOUT_AUTOCLOSE)); 3460 SCTP_TO(SCTP_EVENT_TIMEOUT_AUTOCLOSE));
3461 } 3461 }
3462 3462
3463 /* FIXME: For now send a SACK, but DATA processing may 3463 /* FIXME: For now send a SACK, but DATA processing may
3464 * send another. 3464 * send another.
3465 */ 3465 */
3466 sctp_add_cmd_sf(commands, SCTP_CMD_GEN_SACK, SCTP_NOFORCE()); 3466 sctp_add_cmd_sf(commands, SCTP_CMD_GEN_SACK, SCTP_NOFORCE());
3467 3467
@@ -3511,9 +3511,9 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn_fast(
3511 3511
3512 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_FWDTSN, SCTP_U32(tsn)); 3512 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_FWDTSN, SCTP_U32(tsn));
3513 if (len > sizeof(struct sctp_fwdtsn_hdr)) 3513 if (len > sizeof(struct sctp_fwdtsn_hdr))
3514 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_FWDTSN, 3514 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_FWDTSN,
3515 SCTP_CHUNK(chunk)); 3515 SCTP_CHUNK(chunk));
3516 3516
3517 /* Go a head and force a SACK, since we are shutting down. */ 3517 /* Go a head and force a SACK, since we are shutting down. */
3518gen_shutdown: 3518gen_shutdown:
3519 /* Implementor's Guide. 3519 /* Implementor's Guide.
@@ -3527,7 +3527,7 @@ gen_shutdown:
3527 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART, 3527 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_RESTART,
3528 SCTP_TO(SCTP_EVENT_TIMEOUT_T2_SHUTDOWN)); 3528 SCTP_TO(SCTP_EVENT_TIMEOUT_T2_SHUTDOWN));
3529 3529
3530 return SCTP_DISPOSITION_CONSUME; 3530 return SCTP_DISPOSITION_CONSUME;
3531} 3531}
3532 3532
3533/* 3533/*
@@ -3706,7 +3706,7 @@ sctp_disposition_t sctp_sf_violation(const struct sctp_endpoint *ep,
3706 * if it's length is set to be smaller then the size of sctp_sack_chunk_t. 3706 * if it's length is set to be smaller then the size of sctp_sack_chunk_t.
3707 * 3707 *
3708 * We inform the other end by sending an ABORT with a Protocol Violation 3708 * We inform the other end by sending an ABORT with a Protocol Violation
3709 * error code. 3709 * error code.
3710 * 3710 *
3711 * Section: Not specified 3711 * Section: Not specified
3712 * Verification Tag: Nothing to do 3712 * Verification Tag: Nothing to do
@@ -3747,7 +3747,7 @@ static sctp_disposition_t sctp_sf_violation_chunklen(
3747 SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION)); 3747 SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION));
3748 } else { 3748 } else {
3749 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, 3749 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
3750 SCTP_ERROR(ECONNABORTED)); 3750 SCTP_ERROR(ECONNABORTED));
3751 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 3751 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
3752 SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION)); 3752 SCTP_PERR(SCTP_ERROR_PROTO_VIOLATION));
3753 SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); 3753 SCTP_DEC_STATS(SCTP_MIB_CURRESTAB);
@@ -3756,7 +3756,7 @@ static sctp_disposition_t sctp_sf_violation_chunklen(
3756 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL()); 3756 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
3757 3757
3758 SCTP_INC_STATS(SCTP_MIB_ABORTEDS); 3758 SCTP_INC_STATS(SCTP_MIB_ABORTEDS);
3759 3759
3760 return SCTP_DISPOSITION_ABORT; 3760 return SCTP_DISPOSITION_ABORT;
3761 3761
3762nomem: 3762nomem:
@@ -4437,7 +4437,7 @@ sctp_disposition_t sctp_sf_do_9_2_start_shutdown(
4437 /* sctp-implguide 2.10 Issues with Heartbeating and failover 4437 /* sctp-implguide 2.10 Issues with Heartbeating and failover
4438 * 4438 *
4439 * HEARTBEAT ... is discontinued after sending either SHUTDOWN 4439 * HEARTBEAT ... is discontinued after sending either SHUTDOWN
4440 * or SHUTDOWN-ACK. 4440 * or SHUTDOWN-ACK.
4441 */ 4441 */
4442 sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_STOP, SCTP_NULL()); 4442 sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_STOP, SCTP_NULL());
4443 4443
@@ -4515,7 +4515,7 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown_ack(
4515 /* sctp-implguide 2.10 Issues with Heartbeating and failover 4515 /* sctp-implguide 2.10 Issues with Heartbeating and failover
4516 * 4516 *
4517 * HEARTBEAT ... is discontinued after sending either SHUTDOWN 4517 * HEARTBEAT ... is discontinued after sending either SHUTDOWN
4518 * or SHUTDOWN-ACK. 4518 * or SHUTDOWN-ACK.
4519 */ 4519 */
4520 sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_STOP, SCTP_NULL()); 4520 sctp_add_cmd_sf(commands, SCTP_CMD_HB_TIMERS_STOP, SCTP_NULL());
4521 4521
@@ -4874,7 +4874,7 @@ sctp_disposition_t sctp_sf_t4_timer_expire(
4874 /* ADDIP 4.1 B4) Re-transmit the ASCONF Chunk last sent and if possible 4874 /* ADDIP 4.1 B4) Re-transmit the ASCONF Chunk last sent and if possible
4875 * choose an alternate destination address (please refer to RFC2960 4875 * choose an alternate destination address (please refer to RFC2960
4876 * [5] section 6.4.1). An endpoint MUST NOT add new parameters to this 4876 * [5] section 6.4.1). An endpoint MUST NOT add new parameters to this
4877 * chunk, it MUST be the same (including its serial number) as the last 4877 * chunk, it MUST be the same (including its serial number) as the last
4878 * ASCONF sent. 4878 * ASCONF sent.
4879 */ 4879 */
4880 sctp_chunk_hold(asoc->addip_last_asconf); 4880 sctp_chunk_hold(asoc->addip_last_asconf);
@@ -4953,7 +4953,7 @@ sctp_disposition_t sctp_sf_autoclose_timer_expire(
4953 /* sctpimpguide-05 Section 2.12.2 4953 /* sctpimpguide-05 Section 2.12.2
4954 * The sender of the SHUTDOWN MAY also start an overall guard timer 4954 * The sender of the SHUTDOWN MAY also start an overall guard timer
4955 * 'T5-shutdown-guard' to bound the overall time for shutdown sequence. 4955 * 'T5-shutdown-guard' to bound the overall time for shutdown sequence.
4956 */ 4956 */
4957 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START, 4957 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_START,
4958 SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD)); 4958 SCTP_TO(SCTP_EVENT_TIMEOUT_T5_SHUTDOWN_GUARD));
4959 disposition = SCTP_DISPOSITION_CONSUME; 4959 disposition = SCTP_DISPOSITION_CONSUME;
@@ -5127,7 +5127,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *asoc
5127 vtag = ntohl(init->init_hdr.init_tag); 5127 vtag = ntohl(init->init_hdr.init_tag);
5128 break; 5128 break;
5129 } 5129 }
5130 default: 5130 default:
5131 vtag = ntohl(chunk->sctp_hdr->vtag); 5131 vtag = ntohl(chunk->sctp_hdr->vtag);
5132 break; 5132 break;
5133 } 5133 }
@@ -5176,7 +5176,7 @@ static void sctp_send_stale_cookie_err(const struct sctp_endpoint *ep,
5176 /* Override the OOTB vtag from the cookie. */ 5176 /* Override the OOTB vtag from the cookie. */
5177 cookie = chunk->subh.cookie_hdr; 5177 cookie = chunk->subh.cookie_hdr;
5178 packet->vtag = cookie->c.peer_vtag; 5178 packet->vtag = cookie->c.peer_vtag;
5179 5179
5180 /* Set the skb to the belonging sock for accounting. */ 5180 /* Set the skb to the belonging sock for accounting. */
5181 err_chunk->skb->sk = ep->base.sk; 5181 err_chunk->skb->sk = ep->base.sk;
5182 sctp_packet_append_chunk(packet, err_chunk); 5182 sctp_packet_append_chunk(packet, err_chunk);
@@ -5310,7 +5310,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
5310 sctp_add_cmd_sf(commands, SCTP_CMD_PART_DELIVER, SCTP_NULL()); 5310 sctp_add_cmd_sf(commands, SCTP_CMD_PART_DELIVER, SCTP_NULL());
5311 } 5311 }
5312 5312
5313 /* Spill over rwnd a little bit. Note: While allowed, this spill over 5313 /* Spill over rwnd a little bit. Note: While allowed, this spill over
5314 * seems a bit troublesome in that frag_point varies based on 5314 * seems a bit troublesome in that frag_point varies based on
5315 * PMTU. In cases, such as loopback, this might be a rather 5315 * PMTU. In cases, such as loopback, this might be a rather
5316 * large spill over. 5316 * large spill over.
diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c
index 5f6cc7aa661b..5e54b17377f4 100644
--- a/net/sctp/sm_statetable.c
+++ b/net/sctp/sm_statetable.c
@@ -954,7 +954,7 @@ static const sctp_sm_table_entry_t timeout_event_table[SCTP_NUM_TIMEOUT_TYPES][S
954 TYPE_SCTP_EVENT_TIMEOUT_AUTOCLOSE, 954 TYPE_SCTP_EVENT_TIMEOUT_AUTOCLOSE,
955}; 955};
956 956
957static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(sctp_cid_t cid, 957static const sctp_sm_table_entry_t *sctp_chunk_event_lookup(sctp_cid_t cid,
958 sctp_state_t state) 958 sctp_state_t state)
959{ 959{
960 if (state > SCTP_STATE_MAX) 960 if (state > SCTP_STATE_MAX)
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 388d0fb1a377..536298c2eda2 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -381,12 +381,12 @@ SCTP_STATIC int sctp_do_bind(struct sock *sk, union sctp_addr *addr, int len)
381 381
382 /* ADDIP Section 4.1.1 Congestion Control of ASCONF Chunks 382 /* ADDIP Section 4.1.1 Congestion Control of ASCONF Chunks
383 * 383 *
384 * R1) One and only one ASCONF Chunk MAY be in transit and unacknowledged 384 * R1) One and only one ASCONF Chunk MAY be in transit and unacknowledged
385 * at any one time. If a sender, after sending an ASCONF chunk, decides 385 * at any one time. If a sender, after sending an ASCONF chunk, decides
386 * it needs to transfer another ASCONF Chunk, it MUST wait until the 386 * it needs to transfer another ASCONF Chunk, it MUST wait until the
387 * ASCONF-ACK Chunk returns from the previous ASCONF Chunk before sending a 387 * ASCONF-ACK Chunk returns from the previous ASCONF Chunk before sending a
388 * subsequent ASCONF. Note this restriction binds each side, so at any 388 * subsequent ASCONF. Note this restriction binds each side, so at any
389 * time two ASCONF may be in-transit on any given association (one sent 389 * time two ASCONF may be in-transit on any given association (one sent
390 * from each endpoint). 390 * from each endpoint).
391 */ 391 */
392static int sctp_send_asconf(struct sctp_association *asoc, 392static int sctp_send_asconf(struct sctp_association *asoc,
@@ -396,10 +396,10 @@ static int sctp_send_asconf(struct sctp_association *asoc,
396 396
397 /* If there is an outstanding ASCONF chunk, queue it for later 397 /* If there is an outstanding ASCONF chunk, queue it for later
398 * transmission. 398 * transmission.
399 */ 399 */
400 if (asoc->addip_last_asconf) { 400 if (asoc->addip_last_asconf) {
401 list_add_tail(&chunk->list, &asoc->addip_chunk_list); 401 list_add_tail(&chunk->list, &asoc->addip_chunk_list);
402 goto out; 402 goto out;
403 } 403 }
404 404
405 /* Hold the chunk until an ASCONF_ACK is received. */ 405 /* Hold the chunk until an ASCONF_ACK is received. */
@@ -449,7 +449,7 @@ int sctp_bindx_add(struct sock *sk, struct sockaddr *addrs, int addrcnt)
449 goto err_bindx_add; 449 goto err_bindx_add;
450 } 450 }
451 451
452 retval = sctp_do_bind(sk, (union sctp_addr *)sa_addr, 452 retval = sctp_do_bind(sk, (union sctp_addr *)sa_addr,
453 af->sockaddr_len); 453 af->sockaddr_len);
454 454
455 addr_buf += af->sockaddr_len; 455 addr_buf += af->sockaddr_len;
@@ -470,13 +470,13 @@ err_bindx_add:
470 * associations that are part of the endpoint indicating that a list of local 470 * associations that are part of the endpoint indicating that a list of local
471 * addresses are added to the endpoint. 471 * addresses are added to the endpoint.
472 * 472 *
473 * If any of the addresses is already in the bind address list of the 473 * If any of the addresses is already in the bind address list of the
474 * association, we do not send the chunk for that association. But it will not 474 * association, we do not send the chunk for that association. But it will not
475 * affect other associations. 475 * affect other associations.
476 * 476 *
477 * Only sctp_setsockopt_bindx() is supposed to call this function. 477 * Only sctp_setsockopt_bindx() is supposed to call this function.
478 */ 478 */
479static int sctp_send_asconf_add_ip(struct sock *sk, 479static int sctp_send_asconf_add_ip(struct sock *sk,
480 struct sockaddr *addrs, 480 struct sockaddr *addrs,
481 int addrcnt) 481 int addrcnt)
482{ 482{
@@ -517,8 +517,8 @@ static int sctp_send_asconf_add_ip(struct sock *sk,
517 continue; 517 continue;
518 518
519 /* Check if any address in the packed array of addresses is 519 /* Check if any address in the packed array of addresses is
520 * in the bind address list of the association. If so, 520 * in the bind address list of the association. If so,
521 * do not send the asconf chunk to its peer, but continue with 521 * do not send the asconf chunk to its peer, but continue with
522 * other associations. 522 * other associations.
523 */ 523 */
524 addr_buf = addrs; 524 addr_buf = addrs;
@@ -664,7 +664,7 @@ err_bindx_rem:
664 * the associations that are part of the endpoint indicating that a list of 664 * the associations that are part of the endpoint indicating that a list of
665 * local addresses are removed from the endpoint. 665 * local addresses are removed from the endpoint.
666 * 666 *
667 * If any of the addresses is already in the bind address list of the 667 * If any of the addresses is already in the bind address list of the
668 * association, we do not send the chunk for that association. But it will not 668 * association, we do not send the chunk for that association. But it will not
669 * affect other associations. 669 * affect other associations.
670 * 670 *
@@ -710,7 +710,7 @@ static int sctp_send_asconf_del_ip(struct sock *sk,
710 continue; 710 continue;
711 711
712 /* Check if any address in the packed array of addresses is 712 /* Check if any address in the packed array of addresses is
713 * not present in the bind address list of the association. 713 * not present in the bind address list of the association.
714 * If so, do not send the asconf chunk to its peer, but 714 * If so, do not send the asconf chunk to its peer, but
715 * continue with other associations. 715 * continue with other associations.
716 */ 716 */
@@ -898,7 +898,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
898 return -EFAULT; 898 return -EFAULT;
899 } 899 }
900 900
901 /* Walk through the addrs buffer and count the number of addresses. */ 901 /* Walk through the addrs buffer and count the number of addresses. */
902 addr_buf = kaddrs; 902 addr_buf = kaddrs;
903 while (walk_size < addrs_size) { 903 while (walk_size < addrs_size) {
904 sa_addr = (struct sockaddr *)addr_buf; 904 sa_addr = (struct sockaddr *)addr_buf;
@@ -906,7 +906,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
906 906
907 /* If the address family is not supported or if this address 907 /* If the address family is not supported or if this address
908 * causes the address buffer to overflow return EINVAL. 908 * causes the address buffer to overflow return EINVAL.
909 */ 909 */
910 if (!af || (walk_size + af->sockaddr_len) > addrs_size) { 910 if (!af || (walk_size + af->sockaddr_len) > addrs_size) {
911 kfree(kaddrs); 911 kfree(kaddrs);
912 return -EINVAL; 912 return -EINVAL;
@@ -935,7 +935,7 @@ SCTP_STATIC int sctp_setsockopt_bindx(struct sock* sk,
935 default: 935 default:
936 err = -EINVAL; 936 err = -EINVAL;
937 break; 937 break;
938 }; 938 };
939 939
940out: 940out:
941 kfree(kaddrs); 941 kfree(kaddrs);
@@ -1035,10 +1035,10 @@ static int __sctp_connect(struct sock* sk,
1035 } 1035 }
1036 } else { 1036 } else {
1037 /* 1037 /*
1038 * If an unprivileged user inherits a 1-many 1038 * If an unprivileged user inherits a 1-many
1039 * style socket with open associations on a 1039 * style socket with open associations on a
1040 * privileged port, it MAY be permitted to 1040 * privileged port, it MAY be permitted to
1041 * accept new associations, but it SHOULD NOT 1041 * accept new associations, but it SHOULD NOT
1042 * be permitted to open new associations. 1042 * be permitted to open new associations.
1043 */ 1043 */
1044 if (ep->base.bind_addr.port < PROT_SOCK && 1044 if (ep->base.bind_addr.port < PROT_SOCK &&
@@ -1094,8 +1094,8 @@ static int __sctp_connect(struct sock* sk,
1094out_free: 1094out_free:
1095 1095
1096 SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p" 1096 SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p"
1097 " kaddrs: %p err: %d\n", 1097 " kaddrs: %p err: %d\n",
1098 asoc, kaddrs, err); 1098 asoc, kaddrs, err);
1099 if (asoc) 1099 if (asoc)
1100 sctp_association_free(asoc); 1100 sctp_association_free(asoc);
1101 return err; 1101 return err;
@@ -1435,7 +1435,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1435 * length messages when SCTP_EOF|SCTP_ABORT is not set. 1435 * length messages when SCTP_EOF|SCTP_ABORT is not set.
1436 * If SCTP_ABORT is set, the message length could be non zero with 1436 * If SCTP_ABORT is set, the message length could be non zero with
1437 * the msg_iov set to the user abort reason. 1437 * the msg_iov set to the user abort reason.
1438 */ 1438 */
1439 if (((sinfo_flags & SCTP_EOF) && (msg_len > 0)) || 1439 if (((sinfo_flags & SCTP_EOF) && (msg_len > 0)) ||
1440 (!(sinfo_flags & (SCTP_EOF|SCTP_ABORT)) && (msg_len == 0))) { 1440 (!(sinfo_flags & (SCTP_EOF|SCTP_ABORT)) && (msg_len == 0))) {
1441 err = -EINVAL; 1441 err = -EINVAL;
@@ -1599,7 +1599,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1599 = sinit->sinit_max_attempts; 1599 = sinit->sinit_max_attempts;
1600 } 1600 }
1601 if (sinit->sinit_max_init_timeo) { 1601 if (sinit->sinit_max_init_timeo) {
1602 asoc->max_init_timeo = 1602 asoc->max_init_timeo =
1603 msecs_to_jiffies(sinit->sinit_max_init_timeo); 1603 msecs_to_jiffies(sinit->sinit_max_init_timeo);
1604 } 1604 }
1605 } 1605 }
@@ -2298,7 +2298,7 @@ static int sctp_setsockopt_delayed_ack_time(struct sock *sk,
2298 /* Get association, if assoc_id != 0 and the socket is a one 2298 /* Get association, if assoc_id != 0 and the socket is a one
2299 * to many style socket, and an association was not found, then 2299 * to many style socket, and an association was not found, then
2300 * the id was invalid. 2300 * the id was invalid.
2301 */ 2301 */
2302 asoc = sctp_id2assoc(sk, params.assoc_id); 2302 asoc = sctp_id2assoc(sk, params.assoc_id);
2303 if (!asoc && params.assoc_id && sctp_style(sk, UDP)) 2303 if (!asoc && params.assoc_id && sctp_style(sk, UDP))
2304 return -EINVAL; 2304 return -EINVAL;
@@ -2307,22 +2307,22 @@ static int sctp_setsockopt_delayed_ack_time(struct sock *sk,
2307 if (asoc) { 2307 if (asoc) {
2308 asoc->sackdelay = 2308 asoc->sackdelay =
2309 msecs_to_jiffies(params.assoc_value); 2309 msecs_to_jiffies(params.assoc_value);
2310 asoc->param_flags = 2310 asoc->param_flags =
2311 (asoc->param_flags & ~SPP_SACKDELAY) | 2311 (asoc->param_flags & ~SPP_SACKDELAY) |
2312 SPP_SACKDELAY_ENABLE; 2312 SPP_SACKDELAY_ENABLE;
2313 } else { 2313 } else {
2314 sp->sackdelay = params.assoc_value; 2314 sp->sackdelay = params.assoc_value;
2315 sp->param_flags = 2315 sp->param_flags =
2316 (sp->param_flags & ~SPP_SACKDELAY) | 2316 (sp->param_flags & ~SPP_SACKDELAY) |
2317 SPP_SACKDELAY_ENABLE; 2317 SPP_SACKDELAY_ENABLE;
2318 } 2318 }
2319 } else { 2319 } else {
2320 if (asoc) { 2320 if (asoc) {
2321 asoc->param_flags = 2321 asoc->param_flags =
2322 (asoc->param_flags & ~SPP_SACKDELAY) | 2322 (asoc->param_flags & ~SPP_SACKDELAY) |
2323 SPP_SACKDELAY_DISABLE; 2323 SPP_SACKDELAY_DISABLE;
2324 } else { 2324 } else {
2325 sp->param_flags = 2325 sp->param_flags =
2326 (sp->param_flags & ~SPP_SACKDELAY) | 2326 (sp->param_flags & ~SPP_SACKDELAY) |
2327 SPP_SACKDELAY_DISABLE; 2327 SPP_SACKDELAY_DISABLE;
2328 } 2328 }
@@ -2338,17 +2338,17 @@ static int sctp_setsockopt_delayed_ack_time(struct sock *sk,
2338 if (params.assoc_value) { 2338 if (params.assoc_value) {
2339 trans->sackdelay = 2339 trans->sackdelay =
2340 msecs_to_jiffies(params.assoc_value); 2340 msecs_to_jiffies(params.assoc_value);
2341 trans->param_flags = 2341 trans->param_flags =
2342 (trans->param_flags & ~SPP_SACKDELAY) | 2342 (trans->param_flags & ~SPP_SACKDELAY) |
2343 SPP_SACKDELAY_ENABLE; 2343 SPP_SACKDELAY_ENABLE;
2344 } else { 2344 } else {
2345 trans->param_flags = 2345 trans->param_flags =
2346 (trans->param_flags & ~SPP_SACKDELAY) | 2346 (trans->param_flags & ~SPP_SACKDELAY) |
2347 SPP_SACKDELAY_DISABLE; 2347 SPP_SACKDELAY_DISABLE;
2348 } 2348 }
2349 } 2349 }
2350 } 2350 }
2351 2351
2352 return 0; 2352 return 0;
2353} 2353}
2354 2354
@@ -2374,13 +2374,13 @@ static int sctp_setsockopt_initmsg(struct sock *sk, char __user *optval, int opt
2374 return -EFAULT; 2374 return -EFAULT;
2375 2375
2376 if (sinit.sinit_num_ostreams) 2376 if (sinit.sinit_num_ostreams)
2377 sp->initmsg.sinit_num_ostreams = sinit.sinit_num_ostreams; 2377 sp->initmsg.sinit_num_ostreams = sinit.sinit_num_ostreams;
2378 if (sinit.sinit_max_instreams) 2378 if (sinit.sinit_max_instreams)
2379 sp->initmsg.sinit_max_instreams = sinit.sinit_max_instreams; 2379 sp->initmsg.sinit_max_instreams = sinit.sinit_max_instreams;
2380 if (sinit.sinit_max_attempts) 2380 if (sinit.sinit_max_attempts)
2381 sp->initmsg.sinit_max_attempts = sinit.sinit_max_attempts; 2381 sp->initmsg.sinit_max_attempts = sinit.sinit_max_attempts;
2382 if (sinit.sinit_max_init_timeo) 2382 if (sinit.sinit_max_init_timeo)
2383 sp->initmsg.sinit_max_init_timeo = sinit.sinit_max_init_timeo; 2383 sp->initmsg.sinit_max_init_timeo = sinit.sinit_max_init_timeo;
2384 2384
2385 return 0; 2385 return 0;
2386} 2386}
@@ -2511,7 +2511,7 @@ static int sctp_setsockopt_rtoinfo(struct sock *sk, char __user *optval, int opt
2511 2511
2512 if (asoc) { 2512 if (asoc) {
2513 if (rtoinfo.srto_initial != 0) 2513 if (rtoinfo.srto_initial != 0)
2514 asoc->rto_initial = 2514 asoc->rto_initial =
2515 msecs_to_jiffies(rtoinfo.srto_initial); 2515 msecs_to_jiffies(rtoinfo.srto_initial);
2516 if (rtoinfo.srto_max != 0) 2516 if (rtoinfo.srto_max != 0)
2517 asoc->rto_max = msecs_to_jiffies(rtoinfo.srto_max); 2517 asoc->rto_max = msecs_to_jiffies(rtoinfo.srto_max);
@@ -2665,7 +2665,7 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl
2665 /* Update the frag_point of the existing associations. */ 2665 /* Update the frag_point of the existing associations. */
2666 list_for_each(pos, &(sp->ep->asocs)) { 2666 list_for_each(pos, &(sp->ep->asocs)) {
2667 asoc = list_entry(pos, struct sctp_association, asocs); 2667 asoc = list_entry(pos, struct sctp_association, asocs);
2668 asoc->frag_point = sctp_frag_point(sp, asoc->pathmtu); 2668 asoc->frag_point = sctp_frag_point(sp, asoc->pathmtu);
2669 } 2669 }
2670 2670
2671 return 0; 2671 return 0;
@@ -2703,7 +2703,7 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva
2703 return -EFAULT; 2703 return -EFAULT;
2704 2704
2705 asoc = sctp_id2assoc(sk, prim.sspp_assoc_id); 2705 asoc = sctp_id2assoc(sk, prim.sspp_assoc_id);
2706 if (!asoc) 2706 if (!asoc)
2707 return -EINVAL; 2707 return -EINVAL;
2708 2708
2709 if (!asoc->peer.asconf_capable) 2709 if (!asoc->peer.asconf_capable)
@@ -3015,7 +3015,7 @@ SCTP_STATIC struct sock *sctp_accept(struct sock *sk, int flags, int *err)
3015 3015
3016out: 3016out:
3017 sctp_release_sock(sk); 3017 sctp_release_sock(sk);
3018 *err = error; 3018 *err = error;
3019 return newsk; 3019 return newsk;
3020} 3020}
3021 3021
@@ -3087,7 +3087,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
3087 sp->assocparams.sasoc_cookie_life = sctp_valid_cookie_life; 3087 sp->assocparams.sasoc_cookie_life = sctp_valid_cookie_life;
3088 3088
3089 /* Initialize default event subscriptions. By default, all the 3089 /* Initialize default event subscriptions. By default, all the
3090 * options are off. 3090 * options are off.
3091 */ 3091 */
3092 memset(&sp->subscribe, 0, sizeof(struct sctp_event_subscribe)); 3092 memset(&sp->subscribe, 0, sizeof(struct sctp_event_subscribe));
3093 3093
@@ -3099,8 +3099,8 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk)
3099 sp->pathmtu = 0; // allow default discovery 3099 sp->pathmtu = 0; // allow default discovery
3100 sp->sackdelay = sctp_sack_timeout; 3100 sp->sackdelay = sctp_sack_timeout;
3101 sp->param_flags = SPP_HB_ENABLE | 3101 sp->param_flags = SPP_HB_ENABLE |
3102 SPP_PMTUD_ENABLE | 3102 SPP_PMTUD_ENABLE |
3103 SPP_SACKDELAY_ENABLE; 3103 SPP_SACKDELAY_ENABLE;
3104 3104
3105 /* If enabled no SCTP message fragmentation will be performed. 3105 /* If enabled no SCTP message fragmentation will be performed.
3106 * Configure through SCTP_DISABLE_FRAGMENTS socket option. 3106 * Configure through SCTP_DISABLE_FRAGMENTS socket option.
@@ -3680,7 +3680,7 @@ static int sctp_getsockopt_delayed_ack_time(struct sock *sk, int len,
3680 /* Get association, if assoc_id != 0 and the socket is a one 3680 /* Get association, if assoc_id != 0 and the socket is a one
3681 * to many style socket, and an association was not found, then 3681 * to many style socket, and an association was not found, then
3682 * the id was invalid. 3682 * the id was invalid.
3683 */ 3683 */
3684 asoc = sctp_id2assoc(sk, params.assoc_id); 3684 asoc = sctp_id2assoc(sk, params.assoc_id);
3685 if (!asoc && params.assoc_id && sctp_style(sk, UDP)) 3685 if (!asoc && params.assoc_id && sctp_style(sk, UDP))
3686 return -EINVAL; 3686 return -EINVAL;
@@ -3756,7 +3756,7 @@ static int sctp_getsockopt_peer_addrs_num_old(struct sock *sk, int len,
3756 return cnt; 3756 return cnt;
3757} 3757}
3758 3758
3759/* 3759/*
3760 * Old API for getting list of peer addresses. Does not work for 32-bit 3760 * Old API for getting list of peer addresses. Does not work for 32-bit
3761 * programs running on a 64-bit kernel 3761 * programs running on a 64-bit kernel
3762 */ 3762 */
@@ -3833,7 +3833,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
3833 return -EINVAL; 3833 return -EINVAL;
3834 3834
3835 to = optval + offsetof(struct sctp_getaddrs,addrs); 3835 to = optval + offsetof(struct sctp_getaddrs,addrs);
3836 space_left = len - sizeof(struct sctp_getaddrs) - 3836 space_left = len - sizeof(struct sctp_getaddrs) -
3837 offsetof(struct sctp_getaddrs,addrs); 3837 offsetof(struct sctp_getaddrs,addrs);
3838 3838
3839 list_for_each(pos, &asoc->peer.transport_addr_list) { 3839 list_for_each(pos, &asoc->peer.transport_addr_list) {
@@ -3907,7 +3907,7 @@ static int sctp_getsockopt_local_addrs_num_old(struct sock *sk, int len,
3907 addr = list_entry(pos, 3907 addr = list_entry(pos,
3908 struct sctp_sockaddr_entry, 3908 struct sctp_sockaddr_entry,
3909 list); 3909 list);
3910 if ((PF_INET == sk->sk_family) && 3910 if ((PF_INET == sk->sk_family) &&
3911 (AF_INET6 == addr->a.sa.sa_family)) 3911 (AF_INET6 == addr->a.sa.sa_family))
3912 continue; 3912 continue;
3913 cnt++; 3913 cnt++;
@@ -3941,7 +3941,7 @@ static int sctp_copy_laddrs_to_user_old(struct sock *sk, __u16 port, int max_add
3941 3941
3942 list_for_each_safe(pos, next, &sctp_local_addr_list) { 3942 list_for_each_safe(pos, next, &sctp_local_addr_list) {
3943 addr = list_entry(pos, struct sctp_sockaddr_entry, list); 3943 addr = list_entry(pos, struct sctp_sockaddr_entry, list);
3944 if ((PF_INET == sk->sk_family) && 3944 if ((PF_INET == sk->sk_family) &&
3945 (AF_INET6 == addr->a.sa.sa_family)) 3945 (AF_INET6 == addr->a.sa.sa_family))
3946 continue; 3946 continue;
3947 memcpy(&temp, &addr->a, sizeof(temp)); 3947 memcpy(&temp, &addr->a, sizeof(temp));
@@ -3970,7 +3970,7 @@ static int sctp_copy_laddrs_to_user(struct sock *sk, __u16 port,
3970 3970
3971 list_for_each_safe(pos, next, &sctp_local_addr_list) { 3971 list_for_each_safe(pos, next, &sctp_local_addr_list) {
3972 addr = list_entry(pos, struct sctp_sockaddr_entry, list); 3972 addr = list_entry(pos, struct sctp_sockaddr_entry, list);
3973 if ((PF_INET == sk->sk_family) && 3973 if ((PF_INET == sk->sk_family) &&
3974 (AF_INET6 == addr->a.sa.sa_family)) 3974 (AF_INET6 == addr->a.sa.sa_family))
3975 continue; 3975 continue;
3976 memcpy(&temp, &addr->a, sizeof(temp)); 3976 memcpy(&temp, &addr->a, sizeof(temp));
@@ -4051,7 +4051,7 @@ static int sctp_getsockopt_local_addrs_old(struct sock *sk, int len,
4051 err = cnt; 4051 err = cnt;
4052 goto unlock; 4052 goto unlock;
4053 } 4053 }
4054 goto copy_getaddrs; 4054 goto copy_getaddrs;
4055 } 4055 }
4056 } 4056 }
4057 4057
@@ -4139,7 +4139,7 @@ static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
4139 err = cnt; 4139 err = cnt;
4140 goto unlock; 4140 goto unlock;
4141 } 4141 }
4142 goto copy_getaddrs; 4142 goto copy_getaddrs;
4143 } 4143 }
4144 } 4144 }
4145 4145
@@ -4196,7 +4196,7 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len,
4196 4196
4197 if (!asoc->peer.primary_path) 4197 if (!asoc->peer.primary_path)
4198 return -ENOTCONN; 4198 return -ENOTCONN;
4199 4199
4200 memcpy(&prim.ssp_addr, &asoc->peer.primary_path->ipaddr, 4200 memcpy(&prim.ssp_addr, &asoc->peer.primary_path->ipaddr,
4201 asoc->peer.primary_path->af_specific->sockaddr_len); 4201 asoc->peer.primary_path->af_specific->sockaddr_len);
4202 4202
@@ -4864,7 +4864,7 @@ SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog)
4864 if (!backlog) { 4864 if (!backlog) {
4865 if (sctp_sstate(sk, CLOSED)) 4865 if (sctp_sstate(sk, CLOSED))
4866 return 0; 4866 return 0;
4867 4867
4868 sctp_unhash_endpoint(ep); 4868 sctp_unhash_endpoint(ep);
4869 sk->sk_state = SCTP_SS_CLOSED; 4869 sk->sk_state = SCTP_SS_CLOSED;
4870 } 4870 }
@@ -4872,7 +4872,7 @@ SCTP_STATIC int sctp_seqpacket_listen(struct sock *sk, int backlog)
4872 /* Return if we are already listening. */ 4872 /* Return if we are already listening. */
4873 if (sctp_sstate(sk, LISTENING)) 4873 if (sctp_sstate(sk, LISTENING))
4874 return 0; 4874 return 0;
4875 4875
4876 /* 4876 /*
4877 * If a bind() or sctp_bindx() is not called prior to a listen() 4877 * If a bind() or sctp_bindx() is not called prior to a listen()
4878 * call that allows new associations to be accepted, the system 4878 * call that allows new associations to be accepted, the system
@@ -4907,7 +4907,7 @@ SCTP_STATIC int sctp_stream_listen(struct sock *sk, int backlog)
4907 if (!backlog) { 4907 if (!backlog) {
4908 if (sctp_sstate(sk, CLOSED)) 4908 if (sctp_sstate(sk, CLOSED))
4909 return 0; 4909 return 0;
4910 4910
4911 sctp_unhash_endpoint(ep); 4911 sctp_unhash_endpoint(ep);
4912 sk->sk_state = SCTP_SS_CLOSED; 4912 sk->sk_state = SCTP_SS_CLOSED;
4913 } 4913 }
@@ -5010,7 +5010,7 @@ unsigned int sctp_poll(struct file *file, struct socket *sock, poll_table *wait)
5010 */ 5010 */
5011 if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING)) 5011 if (sctp_style(sk, TCP) && sctp_sstate(sk, LISTENING))
5012 return (!list_empty(&sp->ep->asocs)) ? 5012 return (!list_empty(&sp->ep->asocs)) ?
5013 (POLLIN | POLLRDNORM) : 0; 5013 (POLLIN | POLLRDNORM) : 0;
5014 5014
5015 mask = 0; 5015 mask = 0;
5016 5016
@@ -5430,7 +5430,7 @@ static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p,
5430 DEFINE_WAIT(wait); 5430 DEFINE_WAIT(wait);
5431 5431
5432 SCTP_DEBUG_PRINTK("wait_for_sndbuf: asoc=%p, timeo=%ld, msg_len=%zu\n", 5432 SCTP_DEBUG_PRINTK("wait_for_sndbuf: asoc=%p, timeo=%ld, msg_len=%zu\n",
5433 asoc, (long)(*timeo_p), msg_len); 5433 asoc, (long)(*timeo_p), msg_len);
5434 5434
5435 /* Increment the association's refcnt. */ 5435 /* Increment the association's refcnt. */
5436 sctp_association_hold(asoc); 5436 sctp_association_hold(asoc);
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 3e5936a5f671..a596f5308cb1 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -130,9 +130,9 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
130struct sctp_transport *sctp_transport_new(const union sctp_addr *addr, 130struct sctp_transport *sctp_transport_new(const union sctp_addr *addr,
131 gfp_t gfp) 131 gfp_t gfp)
132{ 132{
133 struct sctp_transport *transport; 133 struct sctp_transport *transport;
134 134
135 transport = t_new(struct sctp_transport, gfp); 135 transport = t_new(struct sctp_transport, gfp);
136 if (!transport) 136 if (!transport)
137 goto fail; 137 goto fail;
138 138
@@ -185,7 +185,7 @@ static void sctp_transport_destroy(struct sctp_transport *transport)
185 if (transport->asoc) 185 if (transport->asoc)
186 sctp_association_put(transport->asoc); 186 sctp_association_put(transport->asoc);
187 187
188 sctp_packet_free(&transport->packet); 188 sctp_packet_free(&transport->packet);
189 189
190 dst_release(transport->dst); 190 dst_release(transport->dst);
191 kfree(transport); 191 kfree(transport);
@@ -268,7 +268,7 @@ void sctp_transport_route(struct sctp_transport *transport,
268 268
269 /* Initialize sk->sk_rcv_saddr, if the transport is the 269 /* Initialize sk->sk_rcv_saddr, if the transport is the
270 * association's active path for getsockname(). 270 * association's active path for getsockname().
271 */ 271 */
272 if (asoc && (transport == asoc->peer.active_path)) 272 if (asoc && (transport == asoc->peer.active_path))
273 opt->pf->af->to_sk_saddr(&transport->saddr, 273 opt->pf->af->to_sk_saddr(&transport->saddr,
274 asoc->base.sk); 274 asoc->base.sk);
@@ -459,8 +459,8 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport,
459 * destination address(es) to which the missing DATA chunks 459 * destination address(es) to which the missing DATA chunks
460 * were last sent, according to the formula described in 460 * were last sent, according to the formula described in
461 * Section 7.2.3. 461 * Section 7.2.3.
462 * 462 *
463 * RFC 2960 7.2.3, sctpimpguide Upon detection of packet 463 * RFC 2960 7.2.3, sctpimpguide Upon detection of packet
464 * losses from SACK (see Section 7.2.4), An endpoint 464 * losses from SACK (see Section 7.2.4), An endpoint
465 * should do the following: 465 * should do the following:
466 * ssthresh = max(cwnd/2, 4*MTU) 466 * ssthresh = max(cwnd/2, 4*MTU)
@@ -488,7 +488,7 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport,
488 if ((jiffies - transport->last_time_ecne_reduced) > 488 if ((jiffies - transport->last_time_ecne_reduced) >
489 transport->rtt) { 489 transport->rtt) {
490 transport->ssthresh = max(transport->cwnd/2, 490 transport->ssthresh = max(transport->cwnd/2,
491 4*transport->asoc->pathmtu); 491 4*transport->asoc->pathmtu);
492 transport->cwnd = transport->ssthresh; 492 transport->cwnd = transport->ssthresh;
493 transport->last_time_ecne_reduced = jiffies; 493 transport->last_time_ecne_reduced = jiffies;
494 } 494 }
diff --git a/net/sctp/tsnmap.c b/net/sctp/tsnmap.c
index 42d9498c64fa..d3192a1babcc 100644
--- a/net/sctp/tsnmap.c
+++ b/net/sctp/tsnmap.c
@@ -277,7 +277,7 @@ static void sctp_tsnmap_update(struct sctp_tsnmap *map)
277 /* Now tsn_map must have been all '1's, 277 /* Now tsn_map must have been all '1's,
278 * so we swap the map and check the overflow table 278 * so we swap the map and check the overflow table
279 */ 279 */
280 __u8 *tmp = map->tsn_map; 280 __u8 *tmp = map->tsn_map;
281 memset(tmp, 0, map->len); 281 memset(tmp, 0, map->len);
282 map->tsn_map = map->overflow_map; 282 map->tsn_map = map->overflow_map;
283 map->overflow_map = tmp; 283 map->overflow_map = tmp;
diff --git a/net/sctp/ulpevent.c b/net/sctp/ulpevent.c
index 445e07a7ac4b..2e11bc8d5d35 100644
--- a/net/sctp/ulpevent.c
+++ b/net/sctp/ulpevent.c
@@ -749,7 +749,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_pdapi(
749 */ 749 */
750 pd->pdapi_length = sizeof(struct sctp_pdapi_event); 750 pd->pdapi_length = sizeof(struct sctp_pdapi_event);
751 751
752 /* pdapi_indication: 32 bits (unsigned integer) 752 /* pdapi_indication: 32 bits (unsigned integer)
753 * 753 *
754 * This field holds the indication being sent to the application. 754 * This field holds the indication being sent to the application.
755 */ 755 */
@@ -790,13 +790,13 @@ void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
790 return; 790 return;
791 791
792 /* Sockets API Extensions for SCTP 792 /* Sockets API Extensions for SCTP
793 * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV) 793 * Section 5.2.2 SCTP Header Information Structure (SCTP_SNDRCV)
794 * 794 *
795 * sinfo_stream: 16 bits (unsigned integer) 795 * sinfo_stream: 16 bits (unsigned integer)
796 * 796 *
797 * For recvmsg() the SCTP stack places the message's stream number in 797 * For recvmsg() the SCTP stack places the message's stream number in
798 * this value. 798 * this value.
799 */ 799 */
800 sinfo.sinfo_stream = event->stream; 800 sinfo.sinfo_stream = event->stream;
801 /* sinfo_ssn: 16 bits (unsigned integer) 801 /* sinfo_ssn: 16 bits (unsigned integer)
802 * 802 *
@@ -828,7 +828,7 @@ void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event,
828 sinfo.sinfo_flags = event->flags; 828 sinfo.sinfo_flags = event->flags;
829 /* sinfo_tsn: 32 bit (unsigned integer) 829 /* sinfo_tsn: 32 bit (unsigned integer)
830 * 830 *
831 * For the receiving side, this field holds a TSN that was 831 * For the receiving side, this field holds a TSN that was
832 * assigned to one of the SCTP Data Chunks. 832 * assigned to one of the SCTP Data Chunks.
833 */ 833 */
834 sinfo.sinfo_tsn = event->tsn; 834 sinfo.sinfo_tsn = event->tsn;
@@ -879,7 +879,7 @@ static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event,
879 * fragment of the real event. However, we still need to do rwnd 879 * fragment of the real event. However, we still need to do rwnd
880 * accounting. 880 * accounting.
881 * In general, the skb passed from IP can have only 1 level of 881 * In general, the skb passed from IP can have only 1 level of
882 * fragments. But we allow multiple levels of fragments. 882 * fragments. But we allow multiple levels of fragments.
883 */ 883 */
884 for (frag = skb_shinfo(skb)->frag_list; frag; frag = frag->next) { 884 for (frag = skb_shinfo(skb)->frag_list; frag; frag = frag->next) {
885 sctp_ulpevent_receive_data(sctp_skb2event(frag), asoc); 885 sctp_ulpevent_receive_data(sctp_skb2event(frag), asoc);
@@ -888,7 +888,7 @@ static void sctp_ulpevent_receive_data(struct sctp_ulpevent *event,
888 888
889/* Do accounting for bytes just read by user and release the references to 889/* Do accounting for bytes just read by user and release the references to
890 * the association. 890 * the association.
891 */ 891 */
892static void sctp_ulpevent_release_data(struct sctp_ulpevent *event) 892static void sctp_ulpevent_release_data(struct sctp_ulpevent *event)
893{ 893{
894 struct sk_buff *skb, *frag; 894 struct sk_buff *skb, *frag;
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index e1d144275f97..f4759a9bdaee 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -191,7 +191,7 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *ulpq, struct sctp_ulpevent *event)
191 queue = &sk->sk_receive_queue; 191 queue = &sk->sk_receive_queue;
192 } else if (ulpq->pd_mode) { 192 } else if (ulpq->pd_mode) {
193 if (event->msg_flags & MSG_NOTIFICATION) 193 if (event->msg_flags & MSG_NOTIFICATION)
194 queue = &sctp_sk(sk)->pd_lobby; 194 queue = &sctp_sk(sk)->pd_lobby;
195 else { 195 else {
196 clear_pd = event->msg_flags & MSG_EOR; 196 clear_pd = event->msg_flags & MSG_EOR;
197 queue = &sk->sk_receive_queue; 197 queue = &sk->sk_receive_queue;
@@ -298,32 +298,32 @@ static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff_head *qu
298 */ 298 */
299 if (last) 299 if (last)
300 last->next = pos; 300 last->next = pos;
301 else { 301 else {
302 if (skb_cloned(f_frag)) { 302 if (skb_cloned(f_frag)) {
303 /* This is a cloned skb, we can't just modify 303 /* This is a cloned skb, we can't just modify
304 * the frag_list. We need a new skb to do that. 304 * the frag_list. We need a new skb to do that.
305 * Instead of calling skb_unshare(), we'll do it 305 * Instead of calling skb_unshare(), we'll do it
306 * ourselves since we need to delay the free. 306 * ourselves since we need to delay the free.
307 */ 307 */
308 new = skb_copy(f_frag, GFP_ATOMIC); 308 new = skb_copy(f_frag, GFP_ATOMIC);
309 if (!new) 309 if (!new)
310 return NULL; /* try again later */ 310 return NULL; /* try again later */
311 311
312 sctp_skb_set_owner_r(new, f_frag->sk); 312 sctp_skb_set_owner_r(new, f_frag->sk);
313 313
314 skb_shinfo(new)->frag_list = pos; 314 skb_shinfo(new)->frag_list = pos;
315 } else 315 } else
316 skb_shinfo(f_frag)->frag_list = pos; 316 skb_shinfo(f_frag)->frag_list = pos;
317 } 317 }
318 318
319 /* Remove the first fragment from the reassembly queue. */ 319 /* Remove the first fragment from the reassembly queue. */
320 __skb_unlink(f_frag, queue); 320 __skb_unlink(f_frag, queue);
321 321
322 /* if we did unshare, then free the old skb and re-assign */ 322 /* if we did unshare, then free the old skb and re-assign */
323 if (new) { 323 if (new) {
324 kfree_skb(f_frag); 324 kfree_skb(f_frag);
325 f_frag = new; 325 f_frag = new;
326 } 326 }
327 327
328 while (pos) { 328 while (pos) {
329 329
@@ -335,7 +335,7 @@ static struct sctp_ulpevent *sctp_make_reassembled_event(struct sk_buff_head *qu
335 335
336 /* Remove the fragment from the reassembly queue. */ 336 /* Remove the fragment from the reassembly queue. */
337 __skb_unlink(pos, queue); 337 __skb_unlink(pos, queue);
338 338
339 /* Break if we have reached the last fragment. */ 339 /* Break if we have reached the last fragment. */
340 if (pos == l_frag) 340 if (pos == l_frag)
341 break; 341 break;
@@ -624,7 +624,7 @@ static inline void sctp_ulpq_store_ordered(struct sctp_ulpq *ulpq,
624 624
625 sid = event->stream; 625 sid = event->stream;
626 ssn = event->ssn; 626 ssn = event->ssn;
627 627
628 cevent = (struct sctp_ulpevent *) pos->cb; 628 cevent = (struct sctp_ulpevent *) pos->cb;
629 csid = cevent->stream; 629 csid = cevent->stream;
630 cssn = cevent->ssn; 630 cssn = cevent->ssn;
@@ -718,11 +718,11 @@ static inline void sctp_ulpq_reap_ordered(struct sctp_ulpq *ulpq)
718 if (cssn != sctp_ssn_peek(in, csid)) 718 if (cssn != sctp_ssn_peek(in, csid))
719 break; 719 break;
720 720
721 /* Found it, so mark in the ssnmap. */ 721 /* Found it, so mark in the ssnmap. */
722 sctp_ssn_next(in, csid); 722 sctp_ssn_next(in, csid);
723 723
724 __skb_unlink(pos, &ulpq->lobby); 724 __skb_unlink(pos, &ulpq->lobby);
725 if (!event) { 725 if (!event) {
726 /* Create a temporary list to collect chunks on. */ 726 /* Create a temporary list to collect chunks on. */
727 event = sctp_skb2event(pos); 727 event = sctp_skb2event(pos);
728 __skb_queue_tail(&temp, sctp_event2skb(event)); 728 __skb_queue_tail(&temp, sctp_event2skb(event));
@@ -755,7 +755,7 @@ void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn)
755 sctp_ssn_skip(in, sid, ssn); 755 sctp_ssn_skip(in, sid, ssn);
756 756
757 /* Go find any other chunks that were waiting for 757 /* Go find any other chunks that were waiting for
758 * ordering and deliver them if needed. 758 * ordering and deliver them if needed.
759 */ 759 */
760 sctp_ulpq_reap_ordered(ulpq); 760 sctp_ulpq_reap_ordered(ulpq);
761 return; 761 return;
@@ -849,7 +849,7 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
849 if (chunk) { 849 if (chunk) {
850 needed = ntohs(chunk->chunk_hdr->length); 850 needed = ntohs(chunk->chunk_hdr->length);
851 needed -= sizeof(sctp_data_chunk_t); 851 needed -= sizeof(sctp_data_chunk_t);
852 } else 852 } else
853 needed = SCTP_DEFAULT_MAXWINDOW; 853 needed = SCTP_DEFAULT_MAXWINDOW;
854 854
855 freed = 0; 855 freed = 0;
@@ -866,7 +866,7 @@ void sctp_ulpq_renege(struct sctp_ulpq *ulpq, struct sctp_chunk *chunk,
866 tsn = ntohl(chunk->subh.data_hdr->tsn); 866 tsn = ntohl(chunk->subh.data_hdr->tsn);
867 sctp_tsnmap_mark(&asoc->peer.tsn_map, tsn); 867 sctp_tsnmap_mark(&asoc->peer.tsn_map, tsn);
868 sctp_ulpq_tail_data(ulpq, chunk, gfp); 868 sctp_ulpq_tail_data(ulpq, chunk, gfp);
869 869
870 sctp_ulpq_partial_delivery(ulpq, chunk, gfp); 870 sctp_ulpq_partial_delivery(ulpq, chunk, gfp);
871 } 871 }
872 872