aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2007-12-13 09:02:43 -0500
committerDavid S. Miller <davem@davemloft.net>2008-01-28 17:57:47 -0500
commit92d31920b84f258badf206eea8aaf5ac677ac535 (patch)
treeb61c5a87ccd5110638df0a4d44924d8dffacbcf1 /net/dccp
parent09f7709f4929666006931f1d4efc498a6d419bbc (diff)
[DCCP]: Shift the retransmit timer for active-close into output.c
When performing active close, RFC 4340, 8.3. requires to retransmit the Close/CloseReq with a backoff-retransmit timer starting at intially 2 RTTs. This patch shifts the existing code for active-close retransmit timer into output.c, so that the retransmit timer is started when the first Close/CloseReq is sent. Previously, the timer was started when, after releasing the socket in dccp_close(), the actively-closing side had not yet reached the CLOSED/TIMEWAIT state. The patch further reduces the initial timeout from 3 seconds to the required 2 RTTs, where - in absence of a known RTT - the fallback value specified in RFC 4340, 3.4 is used. 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')
-rw-r--r--net/dccp/output.c13
-rw-r--r--net/dccp/proto.c18
2 files changed, 12 insertions, 19 deletions
diff --git a/net/dccp/output.c b/net/dccp/output.c
index 7caa7f57bb7e..e97584aa4898 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -574,7 +574,18 @@ void dccp_send_close(struct sock *sk, const int active)
574 dccp_write_xmit(sk, 1); 574 dccp_write_xmit(sk, 1);
575 dccp_skb_entail(sk, skb); 575 dccp_skb_entail(sk, skb);
576 dccp_transmit_skb(sk, skb_clone(skb, prio)); 576 dccp_transmit_skb(sk, skb_clone(skb, prio));
577 /* FIXME do we need a retransmit timer here? */ 577 /*
578 * Retransmission timer for active-close: RFC 4340, 8.3 requires
579 * to retransmit the Close/CloseReq until the CLOSING/CLOSEREQ
580 * state can be left. The initial timeout is 2 RTTs.
581 * Since RTT measurement is done by the CCIDs, there is no easy
582 * way to get an RTT sample. The fallback RTT from RFC 4340, 3.4
583 * is too low (200ms); we use a high value to avoid unnecessary
584 * retransmissions when the link RTT is > 0.2 seconds.
585 * FIXME: Let main module sample RTTs and use that instead.
586 */
587 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
588 DCCP_TIMEOUT_INIT, DCCP_RTO_MAX);
578 } else 589 } else
579 dccp_transmit_skb(sk, skb); 590 dccp_transmit_skb(sk, skb);
580} 591}
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 60f40ec72ff3..8a73c8f98d76 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -996,24 +996,6 @@ adjudge_to_death:
996 if (state != DCCP_CLOSED && sk->sk_state == DCCP_CLOSED) 996 if (state != DCCP_CLOSED && sk->sk_state == DCCP_CLOSED)
997 goto out; 997 goto out;
998 998
999 /*
1000 * The last release_sock may have processed the CLOSE or RESET
1001 * packet moving sock to CLOSED state, if not we have to fire
1002 * the CLOSE/CLOSEREQ retransmission timer, see "8.3. Termination"
1003 * in draft-ietf-dccp-spec-11. -acme
1004 */
1005 if (sk->sk_state == DCCP_CLOSING) {
1006 /* FIXME: should start at 2 * RTT */
1007 /* Timer for repeating the CLOSE/CLOSEREQ until an answer. */
1008 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
1009 inet_csk(sk)->icsk_rto,
1010 DCCP_RTO_MAX);
1011#if 0
1012 /* Yeah, we should use sk->sk_prot->orphan_count, etc */
1013 dccp_set_state(sk, DCCP_CLOSED);
1014#endif
1015 }
1016
1017 if (sk->sk_state == DCCP_CLOSED) 999 if (sk->sk_state == DCCP_CLOSED)
1018 inet_csk_destroy_sock(sk); 1000 inet_csk_destroy_sock(sk);
1019 1001