diff options
-rw-r--r-- | include/net/sctp/constants.h | 2 | ||||
-rw-r--r-- | net/sctp/sm_statefuns.c | 9 | ||||
-rw-r--r-- | net/sctp/socket.c | 1 |
3 files changed, 11 insertions, 1 deletions
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 8bc25f7b04ce..af8c1508109e 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -231,7 +231,7 @@ typedef enum { | |||
231 | SCTP_SS_LISTENING = TCP_LISTEN, | 231 | SCTP_SS_LISTENING = TCP_LISTEN, |
232 | SCTP_SS_ESTABLISHING = TCP_SYN_SENT, | 232 | SCTP_SS_ESTABLISHING = TCP_SYN_SENT, |
233 | SCTP_SS_ESTABLISHED = TCP_ESTABLISHED, | 233 | SCTP_SS_ESTABLISHED = TCP_ESTABLISHED, |
234 | SCTP_SS_DISCONNECTING = TCP_CLOSING, | 234 | SCTP_SS_CLOSING = TCP_CLOSING, |
235 | } sctp_sock_state_t; | 235 | } sctp_sock_state_t; |
236 | 236 | ||
237 | /* These functions map various type to printable names. */ | 237 | /* These functions map various type to printable names. */ |
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 7288192f7df5..50225dd2e6dc 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -334,6 +334,15 @@ sctp_disposition_t sctp_sf_do_5_1B_init(const struct sctp_endpoint *ep, | |||
334 | if (!sctp_chunk_length_valid(chunk, sizeof(sctp_init_chunk_t))) | 334 | if (!sctp_chunk_length_valid(chunk, sizeof(sctp_init_chunk_t))) |
335 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 335 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
336 | 336 | ||
337 | /* If the INIT is coming toward a closing socket, we'll send back | ||
338 | * and ABORT. Essentially, this catches the race of INIT being | ||
339 | * backloged to the socket at the same time as the user isses close(). | ||
340 | * Since the socket and all its associations are going away, we | ||
341 | * can treat this OOTB | ||
342 | */ | ||
343 | if (sctp_sstate(ep->base.sk, CLOSING)) | ||
344 | return sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); | ||
345 | |||
337 | /* Verify the INIT chunk before processing it. */ | 346 | /* Verify the INIT chunk before processing it. */ |
338 | err_chunk = NULL; | 347 | err_chunk = NULL; |
339 | if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, | 348 | if (!sctp_verify_init(asoc, chunk->chunk_hdr->type, |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 971890dbfea0..a7e544e3f28a 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -1361,6 +1361,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout) | |||
1361 | 1361 | ||
1362 | sctp_lock_sock(sk); | 1362 | sctp_lock_sock(sk); |
1363 | sk->sk_shutdown = SHUTDOWN_MASK; | 1363 | sk->sk_shutdown = SHUTDOWN_MASK; |
1364 | sk->sk_state = SCTP_SS_CLOSING; | ||
1364 | 1365 | ||
1365 | ep = sctp_sk(sk)->ep; | 1366 | ep = sctp_sk(sk)->ep; |
1366 | 1367 | ||