diff options
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r-- | net/sctp/sm_statefuns.c | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 07194c2a32df..0c9d5a6950fe 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -1124,7 +1124,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, | |||
1124 | printk(KERN_WARNING | 1124 | printk(KERN_WARNING |
1125 | "%s association %p could not find address " | 1125 | "%s association %p could not find address " |
1126 | NIP6_FMT "\n", | 1126 | NIP6_FMT "\n", |
1127 | __FUNCTION__, | 1127 | __func__, |
1128 | asoc, | 1128 | asoc, |
1129 | NIP6(from_addr.v6.sin6_addr)); | 1129 | NIP6(from_addr.v6.sin6_addr)); |
1130 | } else { | 1130 | } else { |
@@ -1132,7 +1132,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, | |||
1132 | printk(KERN_WARNING | 1132 | printk(KERN_WARNING |
1133 | "%s association %p could not find address " | 1133 | "%s association %p could not find address " |
1134 | NIPQUAD_FMT "\n", | 1134 | NIPQUAD_FMT "\n", |
1135 | __FUNCTION__, | 1135 | __func__, |
1136 | asoc, | 1136 | asoc, |
1137 | NIPQUAD(from_addr.v4.sin_addr.s_addr)); | 1137 | NIPQUAD(from_addr.v4.sin_addr.s_addr)); |
1138 | } | 1138 | } |
@@ -1150,7 +1150,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, | |||
1150 | time_after(jiffies, hbinfo->sent_at + max_interval)) { | 1150 | time_after(jiffies, hbinfo->sent_at + max_interval)) { |
1151 | SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp " | 1151 | SCTP_DEBUG_PRINTK("%s: HEARTBEAT ACK with invalid timestamp " |
1152 | "received for transport: %p\n", | 1152 | "received for transport: %p\n", |
1153 | __FUNCTION__, link); | 1153 | __func__, link); |
1154 | return SCTP_DISPOSITION_DISCARD; | 1154 | return SCTP_DISPOSITION_DISCARD; |
1155 | } | 1155 | } |
1156 | 1156 | ||
@@ -1226,7 +1226,6 @@ static int sctp_sf_check_restart_addrs(const struct sctp_association *new_asoc, | |||
1226 | sctp_cmd_seq_t *commands) | 1226 | sctp_cmd_seq_t *commands) |
1227 | { | 1227 | { |
1228 | struct sctp_transport *new_addr, *addr; | 1228 | struct sctp_transport *new_addr, *addr; |
1229 | struct list_head *pos, *pos2; | ||
1230 | int found; | 1229 | int found; |
1231 | 1230 | ||
1232 | /* Implementor's Guide - Sectin 5.2.2 | 1231 | /* Implementor's Guide - Sectin 5.2.2 |
@@ -1243,12 +1242,11 @@ static int sctp_sf_check_restart_addrs(const struct sctp_association *new_asoc, | |||
1243 | new_addr = NULL; | 1242 | new_addr = NULL; |
1244 | found = 0; | 1243 | found = 0; |
1245 | 1244 | ||
1246 | list_for_each(pos, &new_asoc->peer.transport_addr_list) { | 1245 | list_for_each_entry(new_addr, &new_asoc->peer.transport_addr_list, |
1247 | new_addr = list_entry(pos, struct sctp_transport, transports); | 1246 | transports) { |
1248 | found = 0; | 1247 | found = 0; |
1249 | list_for_each(pos2, &asoc->peer.transport_addr_list) { | 1248 | list_for_each_entry(addr, &asoc->peer.transport_addr_list, |
1250 | addr = list_entry(pos2, struct sctp_transport, | 1249 | transports) { |
1251 | transports); | ||
1252 | if (sctp_cmp_addr_exact(&new_addr->ipaddr, | 1250 | if (sctp_cmp_addr_exact(&new_addr->ipaddr, |
1253 | &addr->ipaddr)) { | 1251 | &addr->ipaddr)) { |
1254 | found = 1; | 1252 | found = 1; |
@@ -3135,12 +3133,8 @@ sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep, | |||
3135 | if (!ev) | 3133 | if (!ev) |
3136 | goto nomem; | 3134 | goto nomem; |
3137 | 3135 | ||
3138 | if (!sctp_add_cmd(commands, SCTP_CMD_EVENT_ULP, | 3136 | sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, |
3139 | SCTP_ULPEVENT(ev))) { | 3137 | SCTP_ULPEVENT(ev)); |
3140 | sctp_ulpevent_free(ev); | ||
3141 | goto nomem; | ||
3142 | } | ||
3143 | |||
3144 | sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR, | 3138 | sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR, |
3145 | SCTP_CHUNK(chunk)); | 3139 | SCTP_CHUNK(chunk)); |
3146 | } | 3140 | } |
@@ -3668,7 +3662,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(const struct sctp_endpoint *ep, | |||
3668 | skb_pull(chunk->skb, len); | 3662 | skb_pull(chunk->skb, len); |
3669 | 3663 | ||
3670 | tsn = ntohl(fwdtsn_hdr->new_cum_tsn); | 3664 | tsn = ntohl(fwdtsn_hdr->new_cum_tsn); |
3671 | SCTP_DEBUG_PRINTK("%s: TSN 0x%x.\n", __FUNCTION__, tsn); | 3665 | SCTP_DEBUG_PRINTK("%s: TSN 0x%x.\n", __func__, tsn); |
3672 | 3666 | ||
3673 | /* The TSN is too high--silently discard the chunk and count on it | 3667 | /* The TSN is too high--silently discard the chunk and count on it |
3674 | * getting retransmitted later. | 3668 | * getting retransmitted later. |
@@ -3728,7 +3722,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn_fast( | |||
3728 | skb_pull(chunk->skb, len); | 3722 | skb_pull(chunk->skb, len); |
3729 | 3723 | ||
3730 | tsn = ntohl(fwdtsn_hdr->new_cum_tsn); | 3724 | tsn = ntohl(fwdtsn_hdr->new_cum_tsn); |
3731 | SCTP_DEBUG_PRINTK("%s: TSN 0x%x.\n", __FUNCTION__, tsn); | 3725 | SCTP_DEBUG_PRINTK("%s: TSN 0x%x.\n", __func__, tsn); |
3732 | 3726 | ||
3733 | /* The TSN is too high--silently discard the chunk and count on it | 3727 | /* The TSN is too high--silently discard the chunk and count on it |
3734 | * getting retransmitted later. | 3728 | * getting retransmitted later. |
@@ -4237,7 +4231,7 @@ static sctp_disposition_t sctp_sf_violation_chunklen( | |||
4237 | void *arg, | 4231 | void *arg, |
4238 | sctp_cmd_seq_t *commands) | 4232 | sctp_cmd_seq_t *commands) |
4239 | { | 4233 | { |
4240 | char err_str[]="The following chunk had invalid length:"; | 4234 | static const char err_str[]="The following chunk had invalid length:"; |
4241 | 4235 | ||
4242 | return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str, | 4236 | return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str, |
4243 | sizeof(err_str)); | 4237 | sizeof(err_str)); |
@@ -4254,7 +4248,7 @@ static sctp_disposition_t sctp_sf_violation_paramlen( | |||
4254 | const sctp_subtype_t type, | 4248 | const sctp_subtype_t type, |
4255 | void *arg, | 4249 | void *arg, |
4256 | sctp_cmd_seq_t *commands) { | 4250 | sctp_cmd_seq_t *commands) { |
4257 | char err_str[] = "The following parameter had invalid length:"; | 4251 | static const char err_str[] = "The following parameter had invalid length:"; |
4258 | 4252 | ||
4259 | return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str, | 4253 | return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str, |
4260 | sizeof(err_str)); | 4254 | sizeof(err_str)); |
@@ -4273,7 +4267,7 @@ static sctp_disposition_t sctp_sf_violation_ctsn( | |||
4273 | void *arg, | 4267 | void *arg, |
4274 | sctp_cmd_seq_t *commands) | 4268 | sctp_cmd_seq_t *commands) |
4275 | { | 4269 | { |
4276 | char err_str[]="The cumulative tsn ack beyond the max tsn currently sent:"; | 4270 | static const char err_str[]="The cumulative tsn ack beyond the max tsn currently sent:"; |
4277 | 4271 | ||
4278 | return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str, | 4272 | return sctp_sf_abort_violation(ep, asoc, arg, commands, err_str, |
4279 | sizeof(err_str)); | 4273 | sizeof(err_str)); |
@@ -4292,7 +4286,7 @@ static sctp_disposition_t sctp_sf_violation_chunk( | |||
4292 | void *arg, | 4286 | void *arg, |
4293 | sctp_cmd_seq_t *commands) | 4287 | sctp_cmd_seq_t *commands) |
4294 | { | 4288 | { |
4295 | char err_str[]="The following chunk violates protocol:"; | 4289 | static const char err_str[]="The following chunk violates protocol:"; |
4296 | 4290 | ||
4297 | if (!asoc) | 4291 | if (!asoc) |
4298 | return sctp_sf_violation(ep, asoc, type, arg, commands); | 4292 | return sctp_sf_violation(ep, asoc, type, arg, commands); |
@@ -5331,6 +5325,8 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep, | |||
5331 | SCTP_DEBUG_PRINTK("Timer T2 expired.\n"); | 5325 | SCTP_DEBUG_PRINTK("Timer T2 expired.\n"); |
5332 | SCTP_INC_STATS(SCTP_MIB_T2_SHUTDOWN_EXPIREDS); | 5326 | SCTP_INC_STATS(SCTP_MIB_T2_SHUTDOWN_EXPIREDS); |
5333 | 5327 | ||
5328 | ((struct sctp_association *)asoc)->shutdown_retries++; | ||
5329 | |||
5334 | if (asoc->overall_error_count >= asoc->max_retrans) { | 5330 | if (asoc->overall_error_count >= asoc->max_retrans) { |
5335 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | 5331 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, |
5336 | SCTP_ERROR(ETIMEDOUT)); | 5332 | SCTP_ERROR(ETIMEDOUT)); |