diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/input.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c index 5a070fb5b278..f2771375bfc0 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -243,7 +243,7 @@ int sctp_rcv(struct sk_buff *skb) | |||
243 | bh_lock_sock(sk); | 243 | bh_lock_sock(sk); |
244 | } | 244 | } |
245 | 245 | ||
246 | if (sock_owned_by_user(sk)) { | 246 | if (sock_owned_by_user(sk) || !sctp_newsk_ready(sk)) { |
247 | if (sctp_add_backlog(sk, skb)) { | 247 | if (sctp_add_backlog(sk, skb)) { |
248 | bh_unlock_sock(sk); | 248 | bh_unlock_sock(sk); |
249 | sctp_chunk_free(chunk); | 249 | sctp_chunk_free(chunk); |
@@ -321,7 +321,7 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) | |||
321 | local_bh_disable(); | 321 | local_bh_disable(); |
322 | bh_lock_sock(sk); | 322 | bh_lock_sock(sk); |
323 | 323 | ||
324 | if (sock_owned_by_user(sk)) { | 324 | if (sock_owned_by_user(sk) || !sctp_newsk_ready(sk)) { |
325 | if (sk_add_backlog(sk, skb, sk->sk_rcvbuf)) | 325 | if (sk_add_backlog(sk, skb, sk->sk_rcvbuf)) |
326 | sctp_chunk_free(chunk); | 326 | sctp_chunk_free(chunk); |
327 | else | 327 | else |
@@ -336,7 +336,13 @@ int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) | |||
336 | if (backloged) | 336 | if (backloged) |
337 | return 0; | 337 | return 0; |
338 | } else { | 338 | } else { |
339 | sctp_inq_push(inqueue, chunk); | 339 | if (!sctp_newsk_ready(sk)) { |
340 | if (!sk_add_backlog(sk, skb, sk->sk_rcvbuf)) | ||
341 | return 0; | ||
342 | sctp_chunk_free(chunk); | ||
343 | } else { | ||
344 | sctp_inq_push(inqueue, chunk); | ||
345 | } | ||
340 | } | 346 | } |
341 | 347 | ||
342 | done: | 348 | done: |