diff options
author | hsu <hsu@FreeBSD.org> | 2003-03-12 20:27:28 +0000 |
---|---|---|
committer | hsu <hsu@FreeBSD.org> | 2003-03-12 20:27:28 +0000 |
commit | e89bff45972f418ac11fe0897158e917ac237bd0 (patch) | |
tree | 956077f4fc837b16d5a347f5bb4ae1cc28d09b21 /sys/netinet | |
parent | b2697c9471c911a71c2cbeb1bfed485ea97acb9a (diff) | |
download | FreeBSD-src-e89bff45972f418ac11fe0897158e917ac237bd0.zip FreeBSD-src-e89bff45972f418ac11fe0897158e917ac237bd0.tar.gz |
Implement the Limited Transmit algorithm (RFC 3042).
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_input.c | 14 | ||||
-rw-r--r-- | sys/netinet/tcp_reass.c | 14 |
2 files changed, 28 insertions, 0 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 7717e06..91c90d8 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -125,6 +125,10 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_RW, &drop_synfin, 0, "Drop TCP packets with SYN+FIN set"); #endif +static int tcp_do_rfc3042 = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_RW, + &tcp_do_rfc3042, 0, "Enable RFC 3042 (Limited Transmit)"); + struct inpcbhead tcb; #define tcb6 tcb /* for KAME src sync over BSD*'s */ struct inpcbinfo tcbinfo; @@ -1760,6 +1764,16 @@ trimthenstep6: if (SEQ_GT(onxt, tp->snd_nxt)) tp->snd_nxt = onxt; goto drop; + } else if (tcp_do_rfc3042) { + u_long oldcwnd = tp->snd_cwnd; + KASSERT(tp->t_dupacks == 1 || + tp->t_dupacks == 2, + ("dupacks not 1 or 2")); + tp->snd_cwnd += tp->t_dupacks * + tp->t_maxseg; + (void) tcp_output(tp); + tp->snd_cwnd = oldcwnd; + goto drop; } } else tp->t_dupacks = 0; diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 7717e06..91c90d8 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -125,6 +125,10 @@ SYSCTL_INT(_net_inet_tcp, OID_AUTO, drop_synfin, CTLFLAG_RW, &drop_synfin, 0, "Drop TCP packets with SYN+FIN set"); #endif +static int tcp_do_rfc3042 = 0; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, rfc3042, CTLFLAG_RW, + &tcp_do_rfc3042, 0, "Enable RFC 3042 (Limited Transmit)"); + struct inpcbhead tcb; #define tcb6 tcb /* for KAME src sync over BSD*'s */ struct inpcbinfo tcbinfo; @@ -1760,6 +1764,16 @@ trimthenstep6: if (SEQ_GT(onxt, tp->snd_nxt)) tp->snd_nxt = onxt; goto drop; + } else if (tcp_do_rfc3042) { + u_long oldcwnd = tp->snd_cwnd; + KASSERT(tp->t_dupacks == 1 || + tp->t_dupacks == 2, + ("dupacks not 1 or 2")); + tp->snd_cwnd += tp->t_dupacks * + tp->t_maxseg; + (void) tcp_output(tp); + tp->snd_cwnd = oldcwnd; + goto drop; } } else tp->t_dupacks = 0; |