aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/sm_statefuns.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r--net/sctp/sm_statefuns.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index a26065be7289..01e002430c85 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -22,9 +22,8 @@
22 * See the GNU General Public License for more details. 22 * See the GNU General Public License for more details.
23 * 23 *
24 * You should have received a copy of the GNU General Public License 24 * You should have received a copy of the GNU General Public License
25 * along with GNU CC; see the file COPYING. If not, write to 25 * along with GNU CC; see the file COPYING. If not, see
26 * the Free Software Foundation, 59 Temple Place - Suite 330, 26 * <http://www.gnu.org/licenses/>.
27 * Boston, MA 02111-1307, USA.
28 * 27 *
29 * Please send any bug reports or fixes you make to the 28 * Please send any bug reports or fixes you make to the
30 * email address(es): 29 * email address(es):
@@ -759,6 +758,12 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net,
759 struct sctp_chunk auth; 758 struct sctp_chunk auth;
760 sctp_ierror_t ret; 759 sctp_ierror_t ret;
761 760
761 /* Make sure that we and the peer are AUTH capable */
762 if (!net->sctp.auth_enable || !new_asoc->peer.auth_capable) {
763 sctp_association_free(new_asoc);
764 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
765 }
766
762 /* set-up our fake chunk so that we can process it */ 767 /* set-up our fake chunk so that we can process it */
763 auth.skb = chunk->auth_chunk; 768 auth.skb = chunk->auth_chunk;
764 auth.asoc = chunk->asoc; 769 auth.asoc = chunk->asoc;
@@ -769,10 +774,6 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(struct net *net,
769 auth.transport = chunk->transport; 774 auth.transport = chunk->transport;
770 775
771 ret = sctp_sf_authenticate(net, ep, new_asoc, type, &auth); 776 ret = sctp_sf_authenticate(net, ep, new_asoc, type, &auth);
772
773 /* We can now safely free the auth_chunk clone */
774 kfree_skb(chunk->auth_chunk);
775
776 if (ret != SCTP_IERROR_NO_ERROR) { 777 if (ret != SCTP_IERROR_NO_ERROR) {
777 sctp_association_free(new_asoc); 778 sctp_association_free(new_asoc);
778 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); 779 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
@@ -2946,7 +2947,7 @@ sctp_disposition_t sctp_sf_eat_data_6_2(struct net *net,
2946 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, 2947 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
2947 commands); 2948 commands);
2948 2949
2949 error = sctp_eat_data(asoc, chunk, commands ); 2950 error = sctp_eat_data(asoc, chunk, commands);
2950 switch (error) { 2951 switch (error) {
2951 case SCTP_IERROR_NO_ERROR: 2952 case SCTP_IERROR_NO_ERROR:
2952 break; 2953 break;
@@ -3067,7 +3068,7 @@ sctp_disposition_t sctp_sf_eat_data_fast_4_4(struct net *net,
3067 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, 3068 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
3068 commands); 3069 commands);
3069 3070
3070 error = sctp_eat_data(asoc, chunk, commands ); 3071 error = sctp_eat_data(asoc, chunk, commands);
3071 switch (error) { 3072 switch (error) {
3072 case SCTP_IERROR_NO_ERROR: 3073 case SCTP_IERROR_NO_ERROR:
3073 case SCTP_IERROR_HIGH_TSN: 3074 case SCTP_IERROR_HIGH_TSN:
@@ -3682,8 +3683,7 @@ sctp_disposition_t sctp_sf_do_asconf(struct net *net,
3682 asconf_ack->dest = chunk->source; 3683 asconf_ack->dest = chunk->source;
3683 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(asconf_ack)); 3684 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(asconf_ack));
3684 if (asoc->new_transport) { 3685 if (asoc->new_transport) {
3685 sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, 3686 sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, commands);
3686 commands);
3687 ((struct sctp_association *)asoc)->new_transport = NULL; 3687 ((struct sctp_association *)asoc)->new_transport = NULL;
3688 } 3688 }
3689 3689
@@ -3766,7 +3766,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net,
3766 */ 3766 */
3767 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, 3767 sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP,
3768 SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); 3768 SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO));
3769 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); 3769 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
3770 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, 3770 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
3771 SCTP_ERROR(ECONNABORTED)); 3771 SCTP_ERROR(ECONNABORTED));
3772 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 3772 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
@@ -3800,7 +3800,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(struct net *net,
3800 /* We are going to ABORT, so we might as well stop 3800 /* We are going to ABORT, so we might as well stop
3801 * processing the rest of the chunks in the packet. 3801 * processing the rest of the chunks in the packet.
3802 */ 3802 */
3803 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); 3803 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
3804 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, 3804 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
3805 SCTP_ERROR(ECONNABORTED)); 3805 SCTP_ERROR(ECONNABORTED));
3806 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 3806 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,
@@ -4452,7 +4452,7 @@ static sctp_disposition_t sctp_sf_violation_chunklen(
4452 void *arg, 4452 void *arg,
4453 sctp_cmd_seq_t *commands) 4453 sctp_cmd_seq_t *commands)
4454{ 4454{
4455 static const char err_str[]="The following chunk had invalid length:"; 4455 static const char err_str[] = "The following chunk had invalid length:";
4456 4456
4457 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, 4457 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4458 sizeof(err_str)); 4458 sizeof(err_str));
@@ -4515,7 +4515,7 @@ static sctp_disposition_t sctp_sf_violation_ctsn(
4515 void *arg, 4515 void *arg,
4516 sctp_cmd_seq_t *commands) 4516 sctp_cmd_seq_t *commands)
4517{ 4517{
4518 static const char err_str[]="The cumulative tsn ack beyond the max tsn currently sent:"; 4518 static const char err_str[] = "The cumulative tsn ack beyond the max tsn currently sent:";
4519 4519
4520 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str, 4520 return sctp_sf_abort_violation(net, ep, asoc, arg, commands, err_str,
4521 sizeof(err_str)); 4521 sizeof(err_str));
@@ -4535,7 +4535,7 @@ static sctp_disposition_t sctp_sf_violation_chunk(
4535 void *arg, 4535 void *arg,
4536 sctp_cmd_seq_t *commands) 4536 sctp_cmd_seq_t *commands)
4537{ 4537{
4538 static const char err_str[]="The following chunk violates protocol:"; 4538 static const char err_str[] = "The following chunk violates protocol:";
4539 4539
4540 if (!asoc) 4540 if (!asoc)
4541 return sctp_sf_violation(net, ep, asoc, type, arg, commands); 4541 return sctp_sf_violation(net, ep, asoc, type, arg, commands);
@@ -4611,7 +4611,7 @@ sctp_disposition_t sctp_sf_do_prm_asoc(struct net *net,
4611 sctp_cmd_seq_t *commands) 4611 sctp_cmd_seq_t *commands)
4612{ 4612{
4613 struct sctp_chunk *repl; 4613 struct sctp_chunk *repl;
4614 struct sctp_association* my_asoc; 4614 struct sctp_association *my_asoc;
4615 4615
4616 /* The comment below says that we enter COOKIE-WAIT AFTER 4616 /* The comment below says that we enter COOKIE-WAIT AFTER
4617 * sending the INIT, but that doesn't actually work in our 4617 * sending the INIT, but that doesn't actually work in our
@@ -6001,7 +6001,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net,
6001 /* Special case the INIT-ACK as there is no peer's vtag 6001 /* Special case the INIT-ACK as there is no peer's vtag
6002 * yet. 6002 * yet.
6003 */ 6003 */
6004 switch(chunk->chunk_hdr->type) { 6004 switch (chunk->chunk_hdr->type) {
6005 case SCTP_CID_INIT_ACK: 6005 case SCTP_CID_INIT_ACK:
6006 { 6006 {
6007 sctp_initack_chunk_t *initack; 6007 sctp_initack_chunk_t *initack;
@@ -6018,7 +6018,7 @@ static struct sctp_packet *sctp_ootb_pkt_new(struct net *net,
6018 /* Special case the INIT and stale COOKIE_ECHO as there is no 6018 /* Special case the INIT and stale COOKIE_ECHO as there is no
6019 * vtag yet. 6019 * vtag yet.
6020 */ 6020 */
6021 switch(chunk->chunk_hdr->type) { 6021 switch (chunk->chunk_hdr->type) {
6022 case SCTP_CID_INIT: 6022 case SCTP_CID_INIT:
6023 { 6023 {
6024 sctp_init_chunk_t *init; 6024 sctp_init_chunk_t *init;
@@ -6178,7 +6178,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
6178 * PMTU. In cases, such as loopback, this might be a rather 6178 * PMTU. In cases, such as loopback, this might be a rather
6179 * large spill over. 6179 * large spill over.
6180 */ 6180 */
6181 if ((!chunk->data_accepted) && (!asoc->rwnd || asoc->rwnd_over || 6181 if ((!chunk->data_accepted) && (!asoc->rwnd ||
6182 (datalen > asoc->rwnd + asoc->frag_point))) { 6182 (datalen > asoc->rwnd + asoc->frag_point))) {
6183 6183
6184 /* If this is the next TSN, consider reneging to make 6184 /* If this is the next TSN, consider reneging to make
@@ -6208,7 +6208,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
6208 */ 6208 */
6209 if (*sk->sk_prot_creator->memory_pressure) { 6209 if (*sk->sk_prot_creator->memory_pressure) {
6210 if (sctp_tsnmap_has_gap(map) && 6210 if (sctp_tsnmap_has_gap(map) &&
6211 (sctp_tsnmap_get_ctsn(map) + 1) == tsn) { 6211 (sctp_tsnmap_get_ctsn(map) + 1) == tsn) {
6212 pr_debug("%s: under pressure, reneging for tsn:%u\n", 6212 pr_debug("%s: under pressure, reneging for tsn:%u\n",
6213 __func__, tsn); 6213 __func__, tsn);
6214 deliver = SCTP_CMD_RENEGE; 6214 deliver = SCTP_CMD_RENEGE;
@@ -6232,7 +6232,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
6232 /* We are going to ABORT, so we might as well stop 6232 /* We are going to ABORT, so we might as well stop
6233 * processing the rest of the chunks in the packet. 6233 * processing the rest of the chunks in the packet.
6234 */ 6234 */
6235 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); 6235 sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET, SCTP_NULL());
6236 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, 6236 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
6237 SCTP_ERROR(ECONNABORTED)); 6237 SCTP_ERROR(ECONNABORTED));
6238 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, 6238 sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED,