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.c77
1 files changed, 47 insertions, 30 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index b3d186856513..f6b7109195a6 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -1179,9 +1179,9 @@ sctp_disposition_t sctp_sf_backbeat_8_3(struct net *net,
1179 /* Check if the timestamp looks valid. */ 1179 /* Check if the timestamp looks valid. */
1180 if (time_after(hbinfo->sent_at, jiffies) || 1180 if (time_after(hbinfo->sent_at, jiffies) ||
1181 time_after(jiffies, hbinfo->sent_at + max_interval)) { 1181 time_after(jiffies, hbinfo->sent_at + max_interval)) {
1182 SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp " 1182 pr_debug("%s: HEARTBEAT ACK with invalid timestamp received "
1183 "received for transport: %p\n", 1183 "for transport:%p\n", __func__, link);
1184 __func__, link); 1184
1185 return SCTP_DISPOSITION_DISCARD; 1185 return SCTP_DISPOSITION_DISCARD;
1186 } 1186 }
1187 1187
@@ -2562,7 +2562,8 @@ static sctp_disposition_t sctp_stop_t1_and_abort(struct net *net,
2562 const struct sctp_association *asoc, 2562 const struct sctp_association *asoc,
2563 struct sctp_transport *transport) 2563 struct sctp_transport *transport)
2564{ 2564{
2565 SCTP_DEBUG_PRINTK("ABORT received (INIT).\n"); 2565 pr_debug("%s: ABORT received (INIT)\n", __func__);
2566
2566 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, 2567 sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
2567 SCTP_STATE(SCTP_STATE_CLOSED)); 2568 SCTP_STATE(SCTP_STATE_CLOSED));
2568 SCTP_INC_STATS(net, SCTP_MIB_ABORTEDS); 2569 SCTP_INC_STATS(net, SCTP_MIB_ABORTEDS);
@@ -2572,6 +2573,7 @@ static sctp_disposition_t sctp_stop_t1_and_abort(struct net *net,
2572 /* CMD_INIT_FAILED will DELETE_TCB. */ 2573 /* CMD_INIT_FAILED will DELETE_TCB. */
2573 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, 2574 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
2574 SCTP_PERR(error)); 2575 SCTP_PERR(error));
2576
2575 return SCTP_DISPOSITION_ABORT; 2577 return SCTP_DISPOSITION_ABORT;
2576} 2578}
2577 2579
@@ -2637,8 +2639,9 @@ sctp_disposition_t sctp_sf_do_9_2_shutdown(struct net *net,
2637 ctsn = ntohl(sdh->cum_tsn_ack); 2639 ctsn = ntohl(sdh->cum_tsn_ack);
2638 2640
2639 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) { 2641 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
2640 SCTP_DEBUG_PRINTK("ctsn %x\n", ctsn); 2642 pr_debug("%s: ctsn:%x, ctsn_ack_point:%x\n", __func__, ctsn,
2641 SCTP_DEBUG_PRINTK("ctsn_ack_point %x\n", asoc->ctsn_ack_point); 2643 asoc->ctsn_ack_point);
2644
2642 return SCTP_DISPOSITION_DISCARD; 2645 return SCTP_DISPOSITION_DISCARD;
2643 } 2646 }
2644 2647
@@ -2721,8 +2724,9 @@ sctp_disposition_t sctp_sf_do_9_2_shut_ctsn(struct net *net,
2721 ctsn = ntohl(sdh->cum_tsn_ack); 2724 ctsn = ntohl(sdh->cum_tsn_ack);
2722 2725
2723 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) { 2726 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
2724 SCTP_DEBUG_PRINTK("ctsn %x\n", ctsn); 2727 pr_debug("%s: ctsn:%x, ctsn_ack_point:%x\n", __func__, ctsn,
2725 SCTP_DEBUG_PRINTK("ctsn_ack_point %x\n", asoc->ctsn_ack_point); 2728 asoc->ctsn_ack_point);
2729
2726 return SCTP_DISPOSITION_DISCARD; 2730 return SCTP_DISPOSITION_DISCARD;
2727 } 2731 }
2728 2732
@@ -3174,8 +3178,9 @@ sctp_disposition_t sctp_sf_eat_sack_6_2(struct net *net,
3174 * Point indicates an out-of-order SACK. 3178 * Point indicates an out-of-order SACK.
3175 */ 3179 */
3176 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) { 3180 if (TSN_lt(ctsn, asoc->ctsn_ack_point)) {
3177 SCTP_DEBUG_PRINTK("ctsn %x\n", ctsn); 3181 pr_debug("%s: ctsn:%x, ctsn_ack_point:%x\n", __func__, ctsn,
3178 SCTP_DEBUG_PRINTK("ctsn_ack_point %x\n", asoc->ctsn_ack_point); 3182 asoc->ctsn_ack_point);
3183
3179 return SCTP_DISPOSITION_DISCARD; 3184 return SCTP_DISPOSITION_DISCARD;
3180 } 3185 }
3181 3186
@@ -3859,7 +3864,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(struct net *net,
3859 skb_pull(chunk->skb, len); 3864 skb_pull(chunk->skb, len);
3860 3865
3861 tsn = ntohl(fwdtsn_hdr->new_cum_tsn); 3866 tsn = ntohl(fwdtsn_hdr->new_cum_tsn);
3862 SCTP_DEBUG_PRINTK("%s: TSN 0x%x.\n", __func__, tsn); 3867 pr_debug("%s: TSN 0x%x\n", __func__, tsn);
3863 3868
3864 /* The TSN is too high--silently discard the chunk and count on it 3869 /* The TSN is too high--silently discard the chunk and count on it
3865 * getting retransmitted later. 3870 * getting retransmitted later.
@@ -3927,7 +3932,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn_fast(
3927 skb_pull(chunk->skb, len); 3932 skb_pull(chunk->skb, len);
3928 3933
3929 tsn = ntohl(fwdtsn_hdr->new_cum_tsn); 3934 tsn = ntohl(fwdtsn_hdr->new_cum_tsn);
3930 SCTP_DEBUG_PRINTK("%s: TSN 0x%x.\n", __func__, tsn); 3935 pr_debug("%s: TSN 0x%x\n", __func__, tsn);
3931 3936
3932 /* The TSN is too high--silently discard the chunk and count on it 3937 /* The TSN is too high--silently discard the chunk and count on it
3933 * getting retransmitted later. 3938 * getting retransmitted later.
@@ -4166,7 +4171,7 @@ sctp_disposition_t sctp_sf_unk_chunk(struct net *net,
4166 struct sctp_chunk *err_chunk; 4171 struct sctp_chunk *err_chunk;
4167 sctp_chunkhdr_t *hdr; 4172 sctp_chunkhdr_t *hdr;
4168 4173
4169 SCTP_DEBUG_PRINTK("Processing the unknown chunk id %d.\n", type.chunk); 4174 pr_debug("%s: processing unknown chunk id:%d\n", __func__, type.chunk);
4170 4175
4171 if (!sctp_vtag_verify(unk_chunk, asoc)) 4176 if (!sctp_vtag_verify(unk_chunk, asoc))
4172 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands); 4177 return sctp_sf_pdiscard(net, ep, asoc, type, arg, commands);
@@ -4256,7 +4261,8 @@ sctp_disposition_t sctp_sf_discard_chunk(struct net *net,
4256 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, 4261 return sctp_sf_violation_chunklen(net, ep, asoc, type, arg,
4257 commands); 4262 commands);
4258 4263
4259 SCTP_DEBUG_PRINTK("Chunk %d is discarded\n", type.chunk); 4264 pr_debug("%s: chunk:%d is discarded\n", __func__, type.chunk);
4265
4260 return SCTP_DISPOSITION_DISCARD; 4266 return SCTP_DISPOSITION_DISCARD;
4261} 4267}
4262 4268
@@ -5184,7 +5190,9 @@ sctp_disposition_t sctp_sf_ignore_primitive(
5184 void *arg, 5190 void *arg,
5185 sctp_cmd_seq_t *commands) 5191 sctp_cmd_seq_t *commands)
5186{ 5192{
5187 SCTP_DEBUG_PRINTK("Primitive type %d is ignored.\n", type.primitive); 5193 pr_debug("%s: primitive type:%d is ignored\n", __func__,
5194 type.primitive);
5195
5188 return SCTP_DISPOSITION_DISCARD; 5196 return SCTP_DISPOSITION_DISCARD;
5189} 5197}
5190 5198
@@ -5379,7 +5387,9 @@ sctp_disposition_t sctp_sf_ignore_other(struct net *net,
5379 void *arg, 5387 void *arg,
5380 sctp_cmd_seq_t *commands) 5388 sctp_cmd_seq_t *commands)
5381{ 5389{
5382 SCTP_DEBUG_PRINTK("The event other type %d is ignored\n", type.other); 5390 pr_debug("%s: the event other type:%d is ignored\n",
5391 __func__, type.other);
5392
5383 return SCTP_DISPOSITION_DISCARD; 5393 return SCTP_DISPOSITION_DISCARD;
5384} 5394}
5385 5395
@@ -5527,7 +5537,8 @@ sctp_disposition_t sctp_sf_t1_init_timer_expire(struct net *net,
5527 struct sctp_bind_addr *bp; 5537 struct sctp_bind_addr *bp;
5528 int attempts = asoc->init_err_counter + 1; 5538 int attempts = asoc->init_err_counter + 1;
5529 5539
5530 SCTP_DEBUG_PRINTK("Timer T1 expired (INIT).\n"); 5540 pr_debug("%s: timer T1 expired (INIT)\n", __func__);
5541
5531 SCTP_INC_STATS(net, SCTP_MIB_T1_INIT_EXPIREDS); 5542 SCTP_INC_STATS(net, SCTP_MIB_T1_INIT_EXPIREDS);
5532 5543
5533 if (attempts <= asoc->max_init_attempts) { 5544 if (attempts <= asoc->max_init_attempts) {
@@ -5546,9 +5557,10 @@ sctp_disposition_t sctp_sf_t1_init_timer_expire(struct net *net,
5546 5557
5547 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl)); 5558 sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
5548 } else { 5559 } else {
5549 SCTP_DEBUG_PRINTK("Giving up on INIT, attempts: %d" 5560 pr_debug("%s: giving up on INIT, attempts:%d "
5550 " max_init_attempts: %d\n", 5561 "max_init_attempts:%d\n", __func__, attempts,
5551 attempts, asoc->max_init_attempts); 5562 asoc->max_init_attempts);
5563
5552 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, 5564 sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR,
5553 SCTP_ERROR(ETIMEDOUT)); 5565 SCTP_ERROR(ETIMEDOUT));
5554 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, 5566 sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED,
@@ -5588,7 +5600,8 @@ sctp_disposition_t sctp_sf_t1_cookie_timer_expire(struct net *net,
5588 struct sctp_chunk *repl = NULL; 5600 struct sctp_chunk *repl = NULL;
5589 int attempts = asoc->init_err_counter + 1; 5601 int attempts = asoc->init_err_counter + 1;
5590 5602
5591 SCTP_DEBUG_PRINTK("Timer T1 expired (COOKIE-ECHO).\n"); 5603 pr_debug("%s: timer T1 expired (COOKIE-ECHO)\n", __func__);
5604
5592 SCTP_INC_STATS(net, SCTP_MIB_T1_COOKIE_EXPIREDS); 5605 SCTP_INC_STATS(net, SCTP_MIB_T1_COOKIE_EXPIREDS);
5593 5606
5594 if (attempts <= asoc->max_init_attempts) { 5607 if (attempts <= asoc->max_init_attempts) {
@@ -5636,7 +5649,8 @@ sctp_disposition_t sctp_sf_t2_timer_expire(struct net *net,
5636{ 5649{
5637 struct sctp_chunk *reply = NULL; 5650 struct sctp_chunk *reply = NULL;
5638 5651
5639 SCTP_DEBUG_PRINTK("Timer T2 expired.\n"); 5652 pr_debug("%s: timer T2 expired\n", __func__);
5653
5640 SCTP_INC_STATS(net, SCTP_MIB_T2_SHUTDOWN_EXPIREDS); 5654 SCTP_INC_STATS(net, SCTP_MIB_T2_SHUTDOWN_EXPIREDS);
5641 5655
5642 ((struct sctp_association *)asoc)->shutdown_retries++; 5656 ((struct sctp_association *)asoc)->shutdown_retries++;
@@ -5777,7 +5791,8 @@ sctp_disposition_t sctp_sf_t5_timer_expire(struct net *net,
5777{ 5791{
5778 struct sctp_chunk *reply = NULL; 5792 struct sctp_chunk *reply = NULL;
5779 5793
5780 SCTP_DEBUG_PRINTK("Timer T5 expired.\n"); 5794 pr_debug("%s: timer T5 expired\n", __func__);
5795
5781 SCTP_INC_STATS(net, SCTP_MIB_T5_SHUTDOWN_GUARD_EXPIREDS); 5796 SCTP_INC_STATS(net, SCTP_MIB_T5_SHUTDOWN_GUARD_EXPIREDS);
5782 5797
5783 reply = sctp_make_abort(asoc, NULL, 0); 5798 reply = sctp_make_abort(asoc, NULL, 0);
@@ -5892,7 +5907,8 @@ sctp_disposition_t sctp_sf_timer_ignore(struct net *net,
5892 void *arg, 5907 void *arg,
5893 sctp_cmd_seq_t *commands) 5908 sctp_cmd_seq_t *commands)
5894{ 5909{
5895 SCTP_DEBUG_PRINTK("Timer %d ignored.\n", type.chunk); 5910 pr_debug("%s: timer %d ignored\n", __func__, type.chunk);
5911
5896 return SCTP_DISPOSITION_CONSUME; 5912 return SCTP_DISPOSITION_CONSUME;
5897} 5913}
5898 5914
@@ -6102,7 +6118,7 @@ static int sctp_eat_data(const struct sctp_association *asoc,
6102 skb_pull(chunk->skb, sizeof(sctp_datahdr_t)); 6118 skb_pull(chunk->skb, sizeof(sctp_datahdr_t));
6103 6119
6104 tsn = ntohl(data_hdr->tsn); 6120 tsn = ntohl(data_hdr->tsn);
6105 SCTP_DEBUG_PRINTK("eat_data: TSN 0x%x.\n", tsn); 6121 pr_debug("%s: TSN 0x%x\n", __func__, tsn);
6106 6122
6107 /* ASSERT: Now skb->data is really the user data. */ 6123 /* ASSERT: Now skb->data is really the user data. */
6108 6124
@@ -6179,12 +6195,12 @@ static int sctp_eat_data(const struct sctp_association *asoc,
6179 */ 6195 */
6180 if (sctp_tsnmap_has_gap(map) && 6196 if (sctp_tsnmap_has_gap(map) &&
6181 (sctp_tsnmap_get_ctsn(map) + 1) == tsn) { 6197 (sctp_tsnmap_get_ctsn(map) + 1) == tsn) {
6182 SCTP_DEBUG_PRINTK("Reneging for tsn:%u\n", tsn); 6198 pr_debug("%s: reneging for tsn:%u\n", __func__, tsn);
6183 deliver = SCTP_CMD_RENEGE; 6199 deliver = SCTP_CMD_RENEGE;
6184 } else { 6200 } else {
6185 SCTP_DEBUG_PRINTK("Discard tsn: %u len: %Zd, " 6201 pr_debug("%s: discard tsn:%u len:%zu, rwnd:%d\n",
6186 "rwnd: %d\n", tsn, datalen, 6202 __func__, tsn, datalen, asoc->rwnd);
6187 asoc->rwnd); 6203
6188 return SCTP_IERROR_IGNORE_TSN; 6204 return SCTP_IERROR_IGNORE_TSN;
6189 } 6205 }
6190 } 6206 }
@@ -6199,7 +6215,8 @@ static int sctp_eat_data(const struct sctp_association *asoc,
6199 if (*sk->sk_prot_creator->memory_pressure) { 6215 if (*sk->sk_prot_creator->memory_pressure) {
6200 if (sctp_tsnmap_has_gap(map) && 6216 if (sctp_tsnmap_has_gap(map) &&
6201 (sctp_tsnmap_get_ctsn(map) + 1) == tsn) { 6217 (sctp_tsnmap_get_ctsn(map) + 1) == tsn) {
6202 SCTP_DEBUG_PRINTK("Under Pressure! Reneging for tsn:%u\n", tsn); 6218 pr_debug("%s: under pressure, reneging for tsn:%u\n",
6219 __func__, tsn);
6203 deliver = SCTP_CMD_RENEGE; 6220 deliver = SCTP_CMD_RENEGE;
6204 } 6221 }
6205 } 6222 }