This puts a limit on transmit queue length and sends back EAGAIN if the
buffer is full.

Signed-off-by: Ian McDonald <[EMAIL PROTECTED]>
---
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 2729fdc..6e3c311 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -633,6 +633,14 @@ int dccp_sendmsg(struct kiocb *iocb, str
                return -EMSGSIZE;
 
        lock_sock(sk);
+
+       if (sysctl_dccp_tx_qlen &&
+          (sk->sk_write_queue.qlen >= sysctl_dccp_tx_qlen)) {
+               /* if sysctl_dccp_tx_qlen == 0 then unlimited tx queue */
+               rc = -EAGAIN;
+               goto out_release;
+       }
+
        timeo = sock_sndtimeo(sk, noblock);
 
        /*
-
To unsubscribe from this list: send the line "unsubscribe dccp" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to