diff options
author | andre <andre@FreeBSD.org> | 2012-10-28 17:25:08 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2012-10-28 17:25:08 +0000 |
commit | 79dbdb05fd2797ee1594cffb5dfae196f0580dd5 (patch) | |
tree | 1c72efa27b238febe6da8532f840afcd3d5ea1cd /sys/netinet/tcp_input.c | |
parent | 5589a42386ec4529bbf328ac2d0d56993c7b6d61 (diff) | |
download | FreeBSD-src-79dbdb05fd2797ee1594cffb5dfae196f0580dd5.zip FreeBSD-src-79dbdb05fd2797ee1594cffb5dfae196f0580dd5.tar.gz |
When SYN or SYN/ACK had to be retransmitted RFC5681 requires us to
reduce the initial CWND to one segment. This reduction got lost
some time ago due to a change in initialization ordering.
Additionally in tcp_timer_rexmt() avoid entering fast recovery when
we're still in TCPS_SYN_SENT state.
MFC after: 2 weeks
Diffstat (limited to 'sys/netinet/tcp_input.c')
-rw-r--r-- | sys/netinet/tcp_input.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 62819cf..8bf1b0c 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -345,10 +345,16 @@ cc_conn_init(struct tcpcb *tp) /* * Set the initial slow-start flight size. * - * RFC3390 says only do this if SYN or SYN/ACK didn't got lost. - * XXX: We currently check only in syncache_socket for that. + * RFC5681 Section 3.1 specifies the default conservative values. + * RFC3390 specifies slightly more aggressive values. + * + * If a SYN or SYN/ACK was lost and retransmitted, we have to + * reduce the initial CWND to one segment as congestion is likely + * requiring us to be cautious. */ - if (V_tcp_do_rfc3390) + if (tp->snd_cwnd == 1) + tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ + else if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); else { |