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.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 71cad56dd73f..177528ed3e1b 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -264,7 +264,6 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
264 struct sctp_chunk *err_chunk; 264 struct sctp_chunk *err_chunk;
265 struct sctp_packet *packet; 265 struct sctp_packet *packet;
266 sctp_unrecognized_param_t *unk_param; 266 sctp_unrecognized_param_t *unk_param;
267 struct sock *sk;
268 int len; 267 int len;
269 268
270 /* 6.10 Bundling 269 /* 6.10 Bundling
@@ -285,16 +284,6 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep,
285 if (ep == sctp_sk((sctp_get_ctl_sock()))->ep) 284 if (ep == sctp_sk((sctp_get_ctl_sock()))->ep)
286 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); 285 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
287 286
288 sk = ep->base.sk;
289 /* If the endpoint is not listening or if the number of associations
290 * on the TCP-style socket exceed the max backlog, respond with an
291 * ABORT.
292 */
293 if (!sctp_sstate(sk, LISTENING) ||
294 (sctp_style(sk, TCP) &&
295 sk_acceptq_is_full(sk)))
296 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
297
298 /* 3.1 A packet containing an INIT chunk MUST have a zero Verification 287 /* 3.1 A packet containing an INIT chunk MUST have a zero Verification
299 * Tag. 288 * Tag.
300 */ 289 */
@@ -590,6 +579,7 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
590 struct sctp_ulpevent *ev, *ai_ev = NULL; 579 struct sctp_ulpevent *ev, *ai_ev = NULL;
591 int error = 0; 580 int error = 0;
592 struct sctp_chunk *err_chk_p; 581 struct sctp_chunk *err_chk_p;
582 struct sock *sk;
593 583
594 /* If the packet is an OOTB packet which is temporarily on the 584 /* If the packet is an OOTB packet which is temporarily on the
595 * control endpoint, respond with an ABORT. 585 * control endpoint, respond with an ABORT.
@@ -605,6 +595,15 @@ sctp_disposition_t sctp_sf_do_5_1D_ce(const struct sctp_endpoint *ep,
605 if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t))) 595 if (!sctp_chunk_length_valid(chunk, sizeof(sctp_chunkhdr_t)))
606 return sctp_sf_pdiscard(ep, asoc, type, arg, commands); 596 return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
607 597
598 /* If the endpoint is not listening or if the number of associations
599 * on the TCP-style socket exceed the max backlog, respond with an
600 * ABORT.
601 */
602 sk = ep->base.sk;
603 if (!sctp_sstate(sk, LISTENING) ||
604 (sctp_style(sk, TCP) && sk_acceptq_is_full(sk)))
605 return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands);
606
608 /* "Decode" the chunk. We have no optional parameters so we 607 /* "Decode" the chunk. We have no optional parameters so we
609 * are in good shape. 608 * are in good shape.
610 */ 609 */
@@ -1032,19 +1031,21 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
1032 /* This should never happen, but lets log it if so. */ 1031 /* This should never happen, but lets log it if so. */
1033 if (unlikely(!link)) { 1032 if (unlikely(!link)) {
1034 if (from_addr.sa.sa_family == AF_INET6) { 1033 if (from_addr.sa.sa_family == AF_INET6) {
1035 printk(KERN_WARNING 1034 if (net_ratelimit())
1036 "%s association %p could not find address " 1035 printk(KERN_WARNING
1037 NIP6_FMT "\n", 1036 "%s association %p could not find address "
1038 __FUNCTION__, 1037 NIP6_FMT "\n",
1039 asoc, 1038 __FUNCTION__,
1040 NIP6(from_addr.v6.sin6_addr)); 1039 asoc,
1040 NIP6(from_addr.v6.sin6_addr));
1041 } else { 1041 } else {
1042 printk(KERN_WARNING 1042 if (net_ratelimit())
1043 "%s association %p could not find address " 1043 printk(KERN_WARNING
1044 NIPQUAD_FMT "\n", 1044 "%s association %p could not find address "
1045 __FUNCTION__, 1045 NIPQUAD_FMT "\n",
1046 asoc, 1046 __FUNCTION__,
1047 NIPQUAD(from_addr.v4.sin_addr.s_addr)); 1047 asoc,
1048 NIPQUAD(from_addr.v4.sin_addr.s_addr));
1048 } 1049 }
1049 return SCTP_DISPOSITION_DISCARD; 1050 return SCTP_DISPOSITION_DISCARD;
1050 } 1051 }
@@ -3362,7 +3363,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
3362 abort = sctp_make_abort(asoc, asconf_ack, 3363 abort = sctp_make_abort(asoc, asconf_ack,
3363 sizeof(sctp_errhdr_t)); 3364 sizeof(sctp_errhdr_t));
3364 if (abort) { 3365 if (abort) {
3365 sctp_init_cause(abort, SCTP_ERROR_ASCONF_ACK, NULL, 0); 3366 sctp_init_cause(abort, SCTP_ERROR_ASCONF_ACK, 0);
3366 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, 3367 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
3367 SCTP_CHUNK(abort)); 3368 SCTP_CHUNK(abort));
3368 } 3369 }
@@ -3392,7 +3393,7 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep,
3392 abort = sctp_make_abort(asoc, asconf_ack, 3393 abort = sctp_make_abort(asoc, asconf_ack,
3393 sizeof(sctp_errhdr_t)); 3394 sizeof(sctp_errhdr_t));
3394 if (abort) { 3395 if (abort) {
3395 sctp_init_cause(abort, SCTP_ERROR_RSRC_LOW, NULL, 0); 3396 sctp_init_cause(abort, SCTP_ERROR_RSRC_LOW, 0);
3396 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, 3397 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
3397 SCTP_CHUNK(abort)); 3398 SCTP_CHUNK(abort));
3398 } 3399 }