Implement the Limited Transmit algorithm (RFC 3042).

This commit is contained in:
Jeffrey Hsu 2003-03-12 20:27:28 +00:00
parent de9840c6e5
commit 582a954b00
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112162
2 changed files with 28 additions and 0 deletions

View file

@ -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 @@ tcp_input(m, off0)
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;

View file

@ -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 @@ tcp_input(m, off0)
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;