aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_make_chunk.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r--net/sctp/sm_make_chunk.c86
1 files changed, 43 insertions, 43 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index fe690320b1e4..3a1767ef3201 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -23,9 +23,8 @@
23 * See the GNU General Public License for more details. 23 * See the GNU General Public License for more details.
24 * 24 *
25 * You should have received a copy of the GNU General Public License 25 * You should have received a copy of the GNU General Public License
26 * along with GNU CC; see the file COPYING. If not, write to 26 * along with GNU CC; see the file COPYING. If not, see
27 * the Free Software Foundation, 59 Temple Place - Suite 330, 27 * <http://www.gnu.org/licenses/>.
28 * Boston, MA 02111-1307, USA.
29 * 28 *
30 * Please send any bug reports or fixes you make to the 29 * Please send any bug reports or fixes you make to the
31 * email address(es): 30 * email address(es):
@@ -79,6 +78,8 @@ static int sctp_process_param(struct sctp_association *asoc,
79 gfp_t gfp); 78 gfp_t gfp);
80static void *sctp_addto_param(struct sctp_chunk *chunk, int len, 79static void *sctp_addto_param(struct sctp_chunk *chunk, int len,
81 const void *data); 80 const void *data);
81static void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len,
82 const void *data);
82 83
83/* Control chunk destructor */ 84/* Control chunk destructor */
84static void sctp_control_release_owner(struct sk_buff *skb) 85static void sctp_control_release_owner(struct sk_buff *skb)
@@ -1420,8 +1421,8 @@ static void sctp_chunk_destroy(struct sctp_chunk *chunk)
1420 BUG_ON(!list_empty(&chunk->list)); 1421 BUG_ON(!list_empty(&chunk->list));
1421 list_del_init(&chunk->transmitted_list); 1422 list_del_init(&chunk->transmitted_list);
1422 1423
1423 /* Free the chunk skb data and the SCTP_chunk stub itself. */ 1424 consume_skb(chunk->skb);
1424 dev_kfree_skb(chunk->skb); 1425 consume_skb(chunk->auth_chunk);
1425 1426
1426 SCTP_DBG_OBJCNT_DEC(chunk); 1427 SCTP_DBG_OBJCNT_DEC(chunk);
1427 kmem_cache_free(sctp_chunk_cachep, chunk); 1428 kmem_cache_free(sctp_chunk_cachep, chunk);
@@ -1476,8 +1477,8 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data)
1476/* Append bytes to the end of a chunk. Returns NULL if there isn't sufficient 1477/* Append bytes to the end of a chunk. Returns NULL if there isn't sufficient
1477 * space in the chunk 1478 * space in the chunk
1478 */ 1479 */
1479void *sctp_addto_chunk_fixed(struct sctp_chunk *chunk, 1480static void *sctp_addto_chunk_fixed(struct sctp_chunk *chunk,
1480 int len, const void *data) 1481 int len, const void *data)
1481{ 1482{
1482 if (skb_tailroom(chunk->skb) >= len) 1483 if (skb_tailroom(chunk->skb) >= len)
1483 return sctp_addto_chunk(chunk, len, data); 1484 return sctp_addto_chunk(chunk, len, data);
@@ -1968,13 +1969,13 @@ static int sctp_verify_ext_param(struct net *net, union sctp_params param)
1968 1969
1969 for (i = 0; i < num_ext; i++) { 1970 for (i = 0; i < num_ext; i++) {
1970 switch (param.ext->chunks[i]) { 1971 switch (param.ext->chunks[i]) {
1971 case SCTP_CID_AUTH: 1972 case SCTP_CID_AUTH:
1972 have_auth = 1; 1973 have_auth = 1;
1973 break; 1974 break;
1974 case SCTP_CID_ASCONF: 1975 case SCTP_CID_ASCONF:
1975 case SCTP_CID_ASCONF_ACK: 1976 case SCTP_CID_ASCONF_ACK:
1976 have_asconf = 1; 1977 have_asconf = 1;
1977 break; 1978 break;
1978 } 1979 }
1979 } 1980 }
1980 1981
@@ -2001,25 +2002,24 @@ static void sctp_process_ext_param(struct sctp_association *asoc,
2001 2002
2002 for (i = 0; i < num_ext; i++) { 2003 for (i = 0; i < num_ext; i++) {
2003 switch (param.ext->chunks[i]) { 2004 switch (param.ext->chunks[i]) {
2004 case SCTP_CID_FWD_TSN: 2005 case SCTP_CID_FWD_TSN:
2005 if (net->sctp.prsctp_enable && 2006 if (net->sctp.prsctp_enable && !asoc->peer.prsctp_capable)
2006 !asoc->peer.prsctp_capable)
2007 asoc->peer.prsctp_capable = 1; 2007 asoc->peer.prsctp_capable = 1;
2008 break; 2008 break;
2009 case SCTP_CID_AUTH: 2009 case SCTP_CID_AUTH:
2010 /* if the peer reports AUTH, assume that he 2010 /* if the peer reports AUTH, assume that he
2011 * supports AUTH. 2011 * supports AUTH.
2012 */ 2012 */
2013 if (net->sctp.auth_enable) 2013 if (net->sctp.auth_enable)
2014 asoc->peer.auth_capable = 1; 2014 asoc->peer.auth_capable = 1;
2015 break; 2015 break;
2016 case SCTP_CID_ASCONF: 2016 case SCTP_CID_ASCONF:
2017 case SCTP_CID_ASCONF_ACK: 2017 case SCTP_CID_ASCONF_ACK:
2018 if (net->sctp.addip_enable) 2018 if (net->sctp.addip_enable)
2019 asoc->peer.asconf_capable = 1; 2019 asoc->peer.asconf_capable = 1;
2020 break; 2020 break;
2021 default: 2021 default:
2022 break; 2022 break;
2023 } 2023 }
2024 } 2024 }
2025} 2025}
@@ -2252,7 +2252,7 @@ int sctp_verify_init(struct net *net, const struct sctp_association *asoc,
2252 * VIOLATION error. We build the ERROR chunk here and let the normal 2252 * VIOLATION error. We build the ERROR chunk here and let the normal
2253 * error handling code build and send the packet. 2253 * error handling code build and send the packet.
2254 */ 2254 */
2255 if (param.v != (void*)chunk->chunk_end) 2255 if (param.v != (void *)chunk->chunk_end)
2256 return sctp_process_inv_paramlength(asoc, param.p, chunk, errp); 2256 return sctp_process_inv_paramlength(asoc, param.p, chunk, errp);
2257 2257
2258 /* The only missing mandatory param possible today is 2258 /* The only missing mandatory param possible today is
@@ -2267,14 +2267,14 @@ int sctp_verify_init(struct net *net, const struct sctp_association *asoc,
2267 2267
2268 result = sctp_verify_param(net, asoc, param, cid, chunk, errp); 2268 result = sctp_verify_param(net, asoc, param, cid, chunk, errp);
2269 switch (result) { 2269 switch (result) {
2270 case SCTP_IERROR_ABORT: 2270 case SCTP_IERROR_ABORT:
2271 case SCTP_IERROR_NOMEM: 2271 case SCTP_IERROR_NOMEM:
2272 return 0; 2272 return 0;
2273 case SCTP_IERROR_ERROR: 2273 case SCTP_IERROR_ERROR:
2274 return 1; 2274 return 1;
2275 case SCTP_IERROR_NO_ERROR: 2275 case SCTP_IERROR_NO_ERROR:
2276 default: 2276 default:
2277 break; 2277 break;
2278 } 2278 }
2279 2279
2280 } /* for (loop through all parameters) */ 2280 } /* for (loop through all parameters) */
@@ -2309,7 +2309,7 @@ int sctp_process_init(struct sctp_association *asoc, struct sctp_chunk *chunk,
2309 * added as the primary transport. The source address seems to 2309 * added as the primary transport. The source address seems to
2310 * be a a better choice than any of the embedded addresses. 2310 * be a a better choice than any of the embedded addresses.
2311 */ 2311 */
2312 if(!sctp_assoc_add_peer(asoc, peer_addr, gfp, SCTP_ACTIVE)) 2312 if (!sctp_assoc_add_peer(asoc, peer_addr, gfp, SCTP_ACTIVE))
2313 goto nomem; 2313 goto nomem;
2314 2314
2315 if (sctp_cmp_addr_exact(sctp_source(chunk), peer_addr)) 2315 if (sctp_cmp_addr_exact(sctp_source(chunk), peer_addr))
@@ -3335,7 +3335,7 @@ static __be16 sctp_get_asconf_response(struct sctp_chunk *asconf_ack,
3335 3335
3336 while (asconf_ack_len > 0) { 3336 while (asconf_ack_len > 0) {
3337 if (asconf_ack_param->crr_id == asconf_param->crr_id) { 3337 if (asconf_ack_param->crr_id == asconf_param->crr_id) {
3338 switch(asconf_ack_param->param_hdr.type) { 3338 switch (asconf_ack_param->param_hdr.type) {
3339 case SCTP_PARAM_SUCCESS_REPORT: 3339 case SCTP_PARAM_SUCCESS_REPORT:
3340 return SCTP_ERROR_NO_ERROR; 3340 return SCTP_ERROR_NO_ERROR;
3341 case SCTP_PARAM_ERR_CAUSE: 3341 case SCTP_PARAM_ERR_CAUSE: