aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/sctp/auth.c12
-rw-r--r--net/sctp/input.c48
-rw-r--r--net/sctp/output.c11
-rw-r--r--net/sctp/sm_make_chunk.c65
-rw-r--r--net/sctp/sm_statefuns.c5
-rw-r--r--net/sctp/sm_statetable.c2
6 files changed, 70 insertions, 73 deletions
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index 889400bbf411..a594b3ca5834 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -647,15 +647,15 @@ static int __sctp_auth_cid(sctp_cid_t chunk, struct sctp_chunks_param *param)
647 */ 647 */
648 for (i = 0; !found && i < len; i++) { 648 for (i = 0; !found && i < len; i++) {
649 switch (param->chunks[i]) { 649 switch (param->chunks[i]) {
650 case SCTP_CID_INIT: 650 case SCTP_CID_INIT:
651 case SCTP_CID_INIT_ACK: 651 case SCTP_CID_INIT_ACK:
652 case SCTP_CID_SHUTDOWN_COMPLETE: 652 case SCTP_CID_SHUTDOWN_COMPLETE:
653 case SCTP_CID_AUTH: 653 case SCTP_CID_AUTH:
654 break; 654 break;
655 655
656 default: 656 default:
657 if (param->chunks[i] == chunk) 657 if (param->chunks[i] == chunk)
658 found = 1; 658 found = 1;
659 break; 659 break;
660 } 660 }
661 } 661 }
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 44f8793d91df..b67e3d83b48a 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -1056,30 +1056,30 @@ static struct sctp_association *__sctp_rcv_walk_lookup(struct net *net,
1056 break; 1056 break;
1057 1057
1058 switch (ch->type) { 1058 switch (ch->type) {
1059 case SCTP_CID_AUTH: 1059 case SCTP_CID_AUTH:
1060 have_auth = chunk_num; 1060 have_auth = chunk_num;
1061 break; 1061 break;
1062 1062
1063 case SCTP_CID_COOKIE_ECHO: 1063 case SCTP_CID_COOKIE_ECHO:
1064 /* If a packet arrives containing an AUTH chunk as 1064 /* If a packet arrives containing an AUTH chunk as
1065 * a first chunk, a COOKIE-ECHO chunk as the second 1065 * a first chunk, a COOKIE-ECHO chunk as the second
1066 * chunk, and possibly more chunks after them, and 1066 * chunk, and possibly more chunks after them, and
1067 * the receiver does not have an STCB for that 1067 * the receiver does not have an STCB for that
1068 * packet, then authentication is based on 1068 * packet, then authentication is based on
1069 * the contents of the COOKIE- ECHO chunk. 1069 * the contents of the COOKIE- ECHO chunk.
1070 */ 1070 */
1071 if (have_auth == 1 && chunk_num == 2) 1071 if (have_auth == 1 && chunk_num == 2)
1072 return NULL; 1072 return NULL;
1073 break; 1073 break;
1074 1074
1075 case SCTP_CID_ASCONF: 1075 case SCTP_CID_ASCONF:
1076 if (have_auth || net->sctp.addip_noauth) 1076 if (have_auth || net->sctp.addip_noauth)
1077 asoc = __sctp_rcv_asconf_lookup( 1077 asoc = __sctp_rcv_asconf_lookup(
1078 net, ch, laddr, 1078 net, ch, laddr,
1079 sctp_hdr(skb)->source, 1079 sctp_hdr(skb)->source,
1080 transportp); 1080 transportp);
1081 default: 1081 default:
1082 break; 1082 break;
1083 } 1083 }
1084 1084
1085 if (asoc) 1085 if (asoc)
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 3be70a41a5de..b971cd226cf5 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -280,7 +280,7 @@ static sctp_xmit_t __sctp_packet_append_chunk(struct sctp_packet *packet,
280 280
281 /* We believe that this chunk is OK to add to the packet */ 281 /* We believe that this chunk is OK to add to the packet */
282 switch (chunk->chunk_hdr->type) { 282 switch (chunk->chunk_hdr->type) {
283 case SCTP_CID_DATA: 283 case SCTP_CID_DATA:
284 /* Account for the data being in the packet */ 284 /* Account for the data being in the packet */
285 sctp_packet_append_data(packet, chunk); 285 sctp_packet_append_data(packet, chunk);
286 /* Disallow SACK bundling after DATA. */ 286 /* Disallow SACK bundling after DATA. */
@@ -292,17 +292,17 @@ static sctp_xmit_t __sctp_packet_append_chunk(struct sctp_packet *packet,
292 /* timestamp the chunk for rtx purposes */ 292 /* timestamp the chunk for rtx purposes */
293 chunk->sent_at = jiffies; 293 chunk->sent_at = jiffies;
294 break; 294 break;
295 case SCTP_CID_COOKIE_ECHO: 295 case SCTP_CID_COOKIE_ECHO:
296 packet->has_cookie_echo = 1; 296 packet->has_cookie_echo = 1;
297 break; 297 break;
298 298
299 case SCTP_CID_SACK: 299 case SCTP_CID_SACK:
300 packet->has_sack = 1; 300 packet->has_sack = 1;
301 if (chunk->asoc) 301 if (chunk->asoc)
302 chunk->asoc->stats.osacks++; 302 chunk->asoc->stats.osacks++;
303 break; 303 break;
304 304
305 case SCTP_CID_AUTH: 305 case SCTP_CID_AUTH:
306 packet->has_auth = 1; 306 packet->has_auth = 1;
307 packet->auth = chunk; 307 packet->auth = chunk;
308 break; 308 break;
@@ -540,8 +540,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
540 } else { 540 } else {
541 /* no need to seed pseudo checksum for SCTP */ 541 /* no need to seed pseudo checksum for SCTP */
542 nskb->ip_summed = CHECKSUM_PARTIAL; 542 nskb->ip_summed = CHECKSUM_PARTIAL;
543 nskb->csum_start = (skb_transport_header(nskb) - 543 nskb->csum_start = skb_transport_header(nskb) - nskb->head;
544 nskb->head);
545 nskb->csum_offset = offsetof(struct sctphdr, checksum); 544 nskb->csum_offset = offsetof(struct sctphdr, checksum);
546 } 545 }
547 } 546 }
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index d53af47efa7d..e5f7cdb42a85 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -1967,13 +1967,13 @@ static int sctp_verify_ext_param(struct net *net, union sctp_params param)
1967 1967
1968 for (i = 0; i < num_ext; i++) { 1968 for (i = 0; i < num_ext; i++) {
1969 switch (param.ext->chunks[i]) { 1969 switch (param.ext->chunks[i]) {
1970 case SCTP_CID_AUTH: 1970 case SCTP_CID_AUTH:
1971 have_auth = 1; 1971 have_auth = 1;
1972 break; 1972 break;
1973 case SCTP_CID_ASCONF: 1973 case SCTP_CID_ASCONF:
1974 case SCTP_CID_ASCONF_ACK: 1974 case SCTP_CID_ASCONF_ACK:
1975 have_asconf = 1; 1975 have_asconf = 1;
1976 break; 1976 break;
1977 } 1977 }
1978 } 1978 }
1979 1979
@@ -2000,25 +2000,24 @@ static void sctp_process_ext_param(struct sctp_association *asoc,
2000 2000
2001 for (i = 0; i < num_ext; i++) { 2001 for (i = 0; i < num_ext; i++) {
2002 switch (param.ext->chunks[i]) { 2002 switch (param.ext->chunks[i]) {
2003 case SCTP_CID_FWD_TSN: 2003 case SCTP_CID_FWD_TSN:
2004 if (net->sctp.prsctp_enable && 2004 if (net->sctp.prsctp_enable && !asoc->peer.prsctp_capable)
2005 !asoc->peer.prsctp_capable)
2006 asoc->peer.prsctp_capable = 1; 2005 asoc->peer.prsctp_capable = 1;
2007 break; 2006 break;
2008 case SCTP_CID_AUTH: 2007 case SCTP_CID_AUTH:
2009 /* if the peer reports AUTH, assume that he 2008 /* if the peer reports AUTH, assume that he
2010 * supports AUTH. 2009 * supports AUTH.
2011 */ 2010 */
2012 if (net->sctp.auth_enable) 2011 if (net->sctp.auth_enable)
2013 asoc->peer.auth_capable = 1; 2012 asoc->peer.auth_capable = 1;
2014 break; 2013 break;
2015 case SCTP_CID_ASCONF: 2014 case SCTP_CID_ASCONF:
2016 case SCTP_CID_ASCONF_ACK: 2015 case SCTP_CID_ASCONF_ACK:
2017 if (net->sctp.addip_enable) 2016 if (net->sctp.addip_enable)
2018 asoc->peer.asconf_capable = 1; 2017 asoc->peer.asconf_capable = 1;
2019 break; 2018 break;
2020 default: 2019 default:
2021 break; 2020 break;
2022 } 2021 }
2023 } 2022 }
2024} 2023}
@@ -2266,14 +2265,14 @@ int sctp_verify_init(struct net *net, const struct sctp_association *asoc,
2266 2265
2267 result = sctp_verify_param(net, asoc, param, cid, chunk, errp); 2266 result = sctp_verify_param(net, asoc, param, cid, chunk, errp);
2268 switch (result) { 2267 switch (result) {
2269 case SCTP_IERROR_ABORT: 2268 case SCTP_IERROR_ABORT:
2270 case SCTP_IERROR_NOMEM: 2269 case SCTP_IERROR_NOMEM:
2271 return 0; 2270 return 0;
2272 case SCTP_IERROR_ERROR: 2271 case SCTP_IERROR_ERROR:
2273 return 1; 2272 return 1;
2274 case SCTP_IERROR_NO_ERROR: 2273 case SCTP_IERROR_NO_ERROR:
2275 default: 2274 default:
2276 break; 2275 break;
2277 } 2276 }
2278 2277
2279 } /* for (loop through all parameters) */ 2278 } /* for (loop through all parameters) */
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 624e4ef9f073..483dcd71b3c5 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -3681,8 +3681,7 @@ sctp_disposition_t sctp_sf_do_asconf(struct net *net,
3681 asconf_ack->dest = chunk->source; 3681 asconf_ack->dest = chunk->source;
3682 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(asconf_ack)); 3682 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(asconf_ack));
3683 if (asoc->new_transport) { 3683 if (asoc->new_transport) {
3684 sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, 3684 sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, commands);
3685 commands);
3686 ((struct sctp_association *)asoc)->new_transport = NULL; 3685 ((struct sctp_association *)asoc)->new_transport = NULL;
3687 } 3686 }
3688 3687
@@ -6207,7 +6206,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
6207 */ 6206 */
6208 if (*sk->sk_prot_creator->memory_pressure) { 6207 if (*sk->sk_prot_creator->memory_pressure) {
6209 if (sctp_tsnmap_has_gap(map) && 6208 if (sctp_tsnmap_has_gap(map) &&
6210 (sctp_tsnmap_get_ctsn(map) + 1) == tsn) { 6209 (sctp_tsnmap_get_ctsn(map) + 1) == tsn) {
6211 pr_debug("%s: under pressure, reneging for tsn:%u\n", 6210 pr_debug("%s: under pressure, reneging for tsn:%u\n",
6212 __func__, tsn); 6211 __func__, tsn);
6213 deliver = SCTP_CMD_RENEGE; 6212 deliver = SCTP_CMD_RENEGE;
diff --git a/net/sctp/sm_statetable.c b/net/sctp/sm_statetable.c
index a4f17437fb22..a987d54b379c 100644
--- a/net/sctp/sm_statetable.c
+++ b/net/sctp/sm_statetable.c
@@ -69,7 +69,7 @@ static const sctp_sm_table_entry_t bug = {
69 if ((event_subtype._type > (_max))) { \ 69 if ((event_subtype._type > (_max))) { \
70 pr_warn("table %p possible attack: event %d exceeds max %d\n", \ 70 pr_warn("table %p possible attack: event %d exceeds max %d\n", \
71 _table, event_subtype._type, _max); \ 71 _table, event_subtype._type, _max); \
72 rtn = &bug; \ 72 rtn = &bug; \
73 } else \ 73 } else \
74 rtn = &_table[event_subtype._type][(int)state]; \ 74 rtn = &_table[event_subtype._type][(int)state]; \
75 \ 75 \