|
@@ -4862,6 +4862,12 @@ int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp)
|
|
|
if (!asoc)
|
|
if (!asoc)
|
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
|
|
+ /* If there is a thread waiting on more sndbuf space for
|
|
|
|
|
+ * sending on this asoc, it cannot be peeled.
|
|
|
|
|
+ */
|
|
|
|
|
+ if (waitqueue_active(&asoc->wait))
|
|
|
|
|
+ return -EBUSY;
|
|
|
|
|
+
|
|
|
/* An association cannot be branched off from an already peeled-off
|
|
/* An association cannot be branched off from an already peeled-off
|
|
|
* socket, nor is this supported for tcp style sockets.
|
|
* socket, nor is this supported for tcp style sockets.
|
|
|
*/
|
|
*/
|
|
@@ -7599,8 +7605,6 @@ static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p,
|
|
|
*/
|
|
*/
|
|
|
release_sock(sk);
|
|
release_sock(sk);
|
|
|
current_timeo = schedule_timeout(current_timeo);
|
|
current_timeo = schedule_timeout(current_timeo);
|
|
|
- if (sk != asoc->base.sk)
|
|
|
|
|
- goto do_error;
|
|
|
|
|
lock_sock(sk);
|
|
lock_sock(sk);
|
|
|
|
|
|
|
|
*timeo_p = current_timeo;
|
|
*timeo_p = current_timeo;
|