Skip to contentSkip to conversation

: Reduce the number of writable states

PATCH In review Arnaldo Carvalho de Melo 1 participant 1 message Sep 26, 2007 Networking

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 : Reduce the number of writable states

Since DCCP requires to close both ends of a connection simultaneously, permission to write in state DCCP_CLOSING is removed in dccp_sendmsg():
* if the sending end closed, it would encounter a write error anyhow;
* if the other end has closed the connection, it accepts no more data.

---
 net/dccp/proto.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/dccp/proto.c +1 -1
index 604de8b..7e4f54a 100644
@@ -664,7 +664,7 @@ int dccp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
 	 * so that the trick in dccp_rcv_request_sent_state_process.
 	 */
 	/* Wait for a connection to finish. */
-	if ((1 << sk->sk_state) & ~(DCCPF_OPEN | DCCPF_PARTOPEN | DCCPF_CLOSING))
+	if ((1 << sk->sk_state) & ~(DCCPF_OPEN | DCCPF_PARTOPEN))
 		if ((rc = sk_stream_wait_connect(sk, &timeo)) != 0)
 			goto out_release;
 
Signature · 1 line
1.5.2.2