diff options
author | Gerrit Renker <gerrit@erg.abdn.ac.uk> | 2007-12-13 12:25:01 -0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 14:57:48 -0800 |
commit | b8599d20708fa3bde1e414689f3474560c2d990b (patch) | |
tree | adeb51da63a75b03fa55ddbc4712c8359240a3bf /net/dccp/output.c | |
parent | 28be5440044d5b19b0331f79fb3e81845ad6d77e (diff) | |
download | op-kernel-dev-b8599d20708fa3bde1e414689f3474560c2d990b.zip op-kernel-dev-b8599d20708fa3bde1e414689f3474560c2d990b.tar.gz |
[DCCP]: Support for server holding timewait state
This adds a socket option and signalling support for the case where the server
holds timewait state on closing the connection, as described in RFC 4340, 8.3.
Since holding timewait state at the server is the non-usual case, it is enabled
via a socket option. Documentation for this socket option has been added.
The setsockopt statement has been made resilient against different possible cases
of expressing boolean `true' values using a suggestion by Ian McDonald.
Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Ian McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp/output.c')
-rw-r--r-- | net/dccp/output.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c index e97584a..b2e1791 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c @@ -567,8 +567,10 @@ void dccp_send_close(struct sock *sk, const int active) /* Reserve space for headers and prepare control bits. */ skb_reserve(skb, sk->sk_prot->max_header); - DCCP_SKB_CB(skb)->dccpd_type = dp->dccps_role == DCCP_ROLE_CLIENT ? - DCCP_PKT_CLOSE : DCCP_PKT_CLOSEREQ; + if (dp->dccps_role == DCCP_ROLE_SERVER && !dp->dccps_server_timewait) + DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_CLOSEREQ; + else + DCCP_SKB_CB(skb)->dccpd_type = DCCP_PKT_CLOSE; if (active) { dccp_write_xmit(sk, 1); |