DCCP protocol discussions
 help / color / mirror / Atom feed
* [PATCH 4/5]: DCCP's passive close needs to match TCP's half-close
@ 2007-09-12 14:35 Gerrit Renker
  2007-09-13  0:25 ` Ian McDonald
  0 siblings, 1 reply; 2+ messages in thread
From: Gerrit Renker @ 2007-09-12 14:35 UTC (permalink / raw)
  To: dccp

[DCCP]: DCCP's passive close needs to match TCP's half-close

This fixes a problem of integrating the new auxiliary states PASSIVE_1/2 with the
inet_xxx infrastructure. 

The problem appears on the listening side and is that
 * a Close may have been received on the socket while it is still in the accept queue
   of the master/listening socket;
 * hence when it is taken out of the queue by inet_accept(), the state of the socket
   is PASSIVE_1 (whose value is greater than all registered TCP states);
 * this triggers the following warning in inet_accept():
  
   Sep 10 16:52:27 kernel: KERNEL: \
	assertion ((1 << sk2->sk_state) & (TCPF_ESTABLISHED | TCPF_CLOSE_WAIT | TCPF_CLOSE))\
	failed at /usr/src/main_davem-2.6/net/ipv4/af_inet.c (646)

The fix consists mapping PASSIVE_1 into TCPF_CLOSE_WAIT, which is possible since
there is no other mapping from a DCCP state into it. Incidentally, the `semantics'
of that state are also similar: in TCP's CLOSE_WAIT, a user confirmation to close
up the socket is needed - and the same (calling close/exit) situation arises here.

For a server deciding to hold TIMEWAIT state there is no such problem, since
DCCP_SOCKOPT_SERVER_TIMEWAIT can not be set on a listening socket, it is by default off
and not inherited to child sockets.

Lastly, for PASSIVE_2 the situation is simpler, since this is a client-only state. 

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
---
 include/linux/dccp.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -249,14 +249,14 @@ enum dccp_state {
 	 * CLOSING, corresponds to (b) above) are used.
 	 */
 	DCCP_CLOSEREQ	= TCP_FIN_WAIT1,
+	DCCP_PASSIVE_1	= TCP_CLOSE_WAIT,	/* any node receiving a Close */
 	DCCP_CLOSING	= TCP_CLOSING,
 	DCCP_TIME_WAIT	= TCP_TIME_WAIT,
 	DCCP_CLOSED	= TCP_CLOSE,
 	/* Everything below here is specific to DCCP only */
 	DCCP_INTRINSICS = TCP_MAX_STATES,
 	DCCP_PARTOPEN,
-	DCCP_PASSIVE_1,		/* any node receiving a Close  */
-	DCCP_PASSIVE_2,		/* client receiving a CloseReq */
+	DCCP_PASSIVE_2,				/* client receiving CloseReq  */
 	DCCP_MAX_STATES
 };
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 4/5]: DCCP's passive close needs to match TCP's half-close
  2007-09-12 14:35 [PATCH 4/5]: DCCP's passive close needs to match TCP's half-close Gerrit Renker
@ 2007-09-13  0:25 ` Ian McDonald
  0 siblings, 0 replies; 2+ messages in thread
From: Ian McDonald @ 2007-09-13  0:25 UTC (permalink / raw)
  To: dccp

On 9/13/07, Gerrit Renker <gerrit@erg.abdn.ac.uk> wrote:
> [DCCP]: DCCP's passive close needs to match TCP's half-close
>
> Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>

Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
-- 
Web1: http://wand.net.nz/~iam4/
Web2: http://www.jandi.co.nz
Blog: http://iansblog.jandi.co.nz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-13  0:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-12 14:35 [PATCH 4/5]: DCCP's passive close needs to match TCP's half-close Gerrit Renker
2007-09-13  0:25 ` Ian McDonald

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox