diff options
-rw-r--r-- | net/sctp/socket.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 673442025bfd..14346dccc4fe 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -6861,6 +6861,9 @@ int sctp_inet_listen(struct socket *sock, int backlog) | |||
6861 | if (sock->state != SS_UNCONNECTED) | 6861 | if (sock->state != SS_UNCONNECTED) |
6862 | goto out; | 6862 | goto out; |
6863 | 6863 | ||
6864 | if (!sctp_sstate(sk, LISTENING) && !sctp_sstate(sk, CLOSED)) | ||
6865 | goto out; | ||
6866 | |||
6864 | /* If backlog is zero, disable listening. */ | 6867 | /* If backlog is zero, disable listening. */ |
6865 | if (!backlog) { | 6868 | if (!backlog) { |
6866 | if (sctp_sstate(sk, CLOSED)) | 6869 | if (sctp_sstate(sk, CLOSED)) |