[RFC PATCH 2/2]: DCCP Introduce tx queue limits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Ian McDonald <ian.mcdonald@xxxxxxxxxxx>
---
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index b9d6e7e..4056308 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -634,6 +634,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 majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [IETF DCCP]     [Linux Networking]     [Git]     [Security]     [Linux Assembly]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux