mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-04 14:39:37 +00:00
Say goodbye to TCP_COMPAT_42
Reviewed by: wollman Requested by: wollman
This commit is contained in:
parent
66542ee60d
commit
d1745f454d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=75733
@ -541,10 +541,6 @@ device stf #6to4 IPv6 over IPv4 encapsulation
|
||||
#
|
||||
# Internet family options:
|
||||
#
|
||||
# TCP_COMPAT_42 causes the TCP code to emulate certain bugs present in
|
||||
# 4.2BSD. This option should not be used unless you have a 4.2BSD
|
||||
# machine and TCP connections fail.
|
||||
#
|
||||
# MROUTING enables the kernel multicast packet forwarder, which works
|
||||
# with mrouted(8).
|
||||
#
|
||||
@ -576,7 +572,6 @@ device stf #6to4 IPv6 over IPv4 encapsulation
|
||||
#
|
||||
# TCPDEBUG is undocumented.
|
||||
#
|
||||
options TCP_COMPAT_42 #emulate 4.2BSD TCP bugs
|
||||
options MROUTING # Multicast routing
|
||||
options IPFIREWALL #firewall
|
||||
options IPFIREWALL_VERBOSE #print information about
|
||||
|
@ -284,7 +284,6 @@ PPP_BSDCOMP opt_ppp.h
|
||||
PPP_DEFLATE opt_ppp.h
|
||||
PPP_FILTER opt_ppp.h
|
||||
SLIP_IFF_OPTS opt_slip.h
|
||||
TCP_COMPAT_42 opt_compat.h
|
||||
TCPDEBUG
|
||||
TCP_DROP_SYNFIN opt_tcp_input.h
|
||||
XBONEHACK
|
||||
|
@ -541,10 +541,6 @@ device stf #6to4 IPv6 over IPv4 encapsulation
|
||||
#
|
||||
# Internet family options:
|
||||
#
|
||||
# TCP_COMPAT_42 causes the TCP code to emulate certain bugs present in
|
||||
# 4.2BSD. This option should not be used unless you have a 4.2BSD
|
||||
# machine and TCP connections fail.
|
||||
#
|
||||
# MROUTING enables the kernel multicast packet forwarder, which works
|
||||
# with mrouted(8).
|
||||
#
|
||||
@ -576,7 +572,6 @@ device stf #6to4 IPv6 over IPv4 encapsulation
|
||||
#
|
||||
# TCPDEBUG is undocumented.
|
||||
#
|
||||
options TCP_COMPAT_42 #emulate 4.2BSD TCP bugs
|
||||
options MROUTING # Multicast routing
|
||||
options IPFIREWALL #firewall
|
||||
options IPFIREWALL_VERBOSE #print information about
|
||||
|
@ -1111,12 +1111,7 @@ findpcb:
|
||||
if (iss)
|
||||
tp->iss = iss;
|
||||
else {
|
||||
#ifdef TCP_COMPAT_42
|
||||
tcp_iss += TCP_ISSINCR/2;
|
||||
tp->iss = tcp_iss;
|
||||
#else
|
||||
tp->iss = tcp_rndiss_next();
|
||||
#endif /* TCP_COMPAT_42 */
|
||||
}
|
||||
tp->irs = th->th_seq;
|
||||
tcp_sendseqinit(tp);
|
||||
@ -1648,11 +1643,7 @@ trimthenstep6:
|
||||
if (thflags & TH_SYN &&
|
||||
tp->t_state == TCPS_TIME_WAIT &&
|
||||
SEQ_GT(th->th_seq, tp->rcv_nxt)) {
|
||||
#ifdef TCP_COMPAT_42
|
||||
iss = tp->snd_nxt + TCP_ISSINCR;
|
||||
#else
|
||||
iss = tcp_rndiss_next();
|
||||
#endif /* TCP_COMPAT_42 */
|
||||
tp = tcp_close(tp);
|
||||
goto findpcb;
|
||||
}
|
||||
|
@ -1111,12 +1111,7 @@ findpcb:
|
||||
if (iss)
|
||||
tp->iss = iss;
|
||||
else {
|
||||
#ifdef TCP_COMPAT_42
|
||||
tcp_iss += TCP_ISSINCR/2;
|
||||
tp->iss = tcp_iss;
|
||||
#else
|
||||
tp->iss = tcp_rndiss_next();
|
||||
#endif /* TCP_COMPAT_42 */
|
||||
}
|
||||
tp->irs = th->th_seq;
|
||||
tcp_sendseqinit(tp);
|
||||
@ -1648,11 +1643,7 @@ trimthenstep6:
|
||||
if (thflags & TH_SYN &&
|
||||
tp->t_state == TCPS_TIME_WAIT &&
|
||||
SEQ_GT(th->th_seq, tp->rcv_nxt)) {
|
||||
#ifdef TCP_COMPAT_42
|
||||
iss = tp->snd_nxt + TCP_ISSINCR;
|
||||
#else
|
||||
iss = tcp_rndiss_next();
|
||||
#endif /* TCP_COMPAT_42 */
|
||||
tp = tcp_close(tp);
|
||||
goto findpcb;
|
||||
}
|
||||
|
@ -81,23 +81,6 @@
|
||||
#ifdef _KERNEL
|
||||
extern tcp_cc tcp_ccgen; /* global connection count */
|
||||
|
||||
#ifdef TCP_COMPAT_42
|
||||
/*
|
||||
* Increment for tcp_iss each second.
|
||||
* This is designed to increment at the standard 250 KB/s,
|
||||
* but with a random component averaging 128 KB.
|
||||
* We also increment tcp_iss by a quarter of this amount
|
||||
* each time we use the value for a new connection.
|
||||
* If defined, the tcp_random18() macro should produce a
|
||||
* number in the range [0-0x3ffff] that is hard to predict.
|
||||
*/
|
||||
#ifndef tcp_random18
|
||||
#define tcp_random18() (arc4random() & 0x3ffff)
|
||||
#endif
|
||||
#define TCP_ISSINCR (122*1024 + tcp_random18())
|
||||
|
||||
extern tcp_seq tcp_iss; /* tcp initial send seq # */
|
||||
#endif /* TCP_COMPAT_42 */
|
||||
#else
|
||||
#define TCP_ISSINCR (250*1024) /* increment for tcp_iss each second */
|
||||
#endif /* _KERNEL */
|
||||
|
@ -182,9 +182,6 @@ tcp_init()
|
||||
{
|
||||
int hashsize;
|
||||
|
||||
#ifdef TCP_COMPAT_42
|
||||
tcp_iss = 1; /* wrong */
|
||||
#endif /* TCP_COMPAT_42 */
|
||||
tcp_ccgen = 1;
|
||||
tcp_cleartaocache();
|
||||
|
||||
@ -352,11 +349,7 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags)
|
||||
m = m_gethdr(M_DONTWAIT, MT_HEADER);
|
||||
if (m == NULL)
|
||||
return;
|
||||
#ifdef TCP_COMPAT_42
|
||||
tlen = 1;
|
||||
#else
|
||||
tlen = 0;
|
||||
#endif
|
||||
m->m_data += max_linkhdr;
|
||||
#ifdef INET6
|
||||
if (isipv6) {
|
||||
|
@ -132,11 +132,6 @@ tcp_slowtimo()
|
||||
|
||||
tcp_maxidle = tcp_keepcnt * tcp_keepintvl;
|
||||
|
||||
#ifdef TCP_COMPAT_42
|
||||
tcp_iss += TCP_ISSINCR/PR_SLOWHZ; /* increment iss */
|
||||
if ((int)tcp_iss < 0)
|
||||
tcp_iss = TCP_ISSINCR; /* XXX */
|
||||
#endif
|
||||
splx(s);
|
||||
}
|
||||
|
||||
@ -264,19 +259,9 @@ tcp_timer_keep(xtp)
|
||||
* correspondent TCP to respond.
|
||||
*/
|
||||
tcpstat.tcps_keepprobe++;
|
||||
#ifdef TCP_COMPAT_42
|
||||
/*
|
||||
* The keepalive packet must have nonzero length
|
||||
* to get a 4.2 host to respond.
|
||||
*/
|
||||
tcp_respond(tp, tp->t_template->tt_ipgen,
|
||||
&tp->t_template->tt_t, (struct mbuf *)NULL,
|
||||
tp->rcv_nxt - 1, tp->snd_una - 1, 0);
|
||||
#else
|
||||
tcp_respond(tp, tp->t_template->tt_ipgen,
|
||||
&tp->t_template->tt_t, (struct mbuf *)NULL,
|
||||
tp->rcv_nxt, tp->snd_una - 1, 0);
|
||||
#endif
|
||||
callout_reset(tp->tt_keep, tcp_keepintvl, tcp_timer_keep, tp);
|
||||
} else
|
||||
callout_reset(tp->tt_keep, tcp_keepidle, tcp_timer_keep, tp);
|
||||
|
@ -182,9 +182,6 @@ tcp_init()
|
||||
{
|
||||
int hashsize;
|
||||
|
||||
#ifdef TCP_COMPAT_42
|
||||
tcp_iss = 1; /* wrong */
|
||||
#endif /* TCP_COMPAT_42 */
|
||||
tcp_ccgen = 1;
|
||||
tcp_cleartaocache();
|
||||
|
||||
@ -352,11 +349,7 @@ tcp_respond(tp, ipgen, th, m, ack, seq, flags)
|
||||
m = m_gethdr(M_DONTWAIT, MT_HEADER);
|
||||
if (m == NULL)
|
||||
return;
|
||||
#ifdef TCP_COMPAT_42
|
||||
tlen = 1;
|
||||
#else
|
||||
tlen = 0;
|
||||
#endif
|
||||
m->m_data += max_linkhdr;
|
||||
#ifdef INET6
|
||||
if (isipv6) {
|
||||
|
@ -761,12 +761,7 @@ tcp_connect(tp, nam, p)
|
||||
tcpstat.tcps_connattempt++;
|
||||
tp->t_state = TCPS_SYN_SENT;
|
||||
callout_reset(tp->tt_keep, tcp_keepinit, tcp_timer_keep, tp);
|
||||
#ifdef TCP_COMPAT_42
|
||||
tp->iss = tcp_iss;
|
||||
tcp_iss += TCP_ISSINCR/2;
|
||||
#else /* TCP_COMPAT_42 */
|
||||
tp->iss = tcp_rndiss_next();
|
||||
#endif /* !TCP_COMPAT_42 */
|
||||
tcp_sendseqinit(tp);
|
||||
|
||||
/*
|
||||
@ -858,11 +853,7 @@ tcp6_connect(tp, nam, p)
|
||||
tcpstat.tcps_connattempt++;
|
||||
tp->t_state = TCPS_SYN_SENT;
|
||||
callout_reset(tp->tt_keep, tcp_keepinit, tcp_timer_keep, tp);
|
||||
#ifdef TCP_COMPAT_42
|
||||
tp->iss = tcp_iss; tcp_iss += TCP_ISSINCR/2;
|
||||
#else
|
||||
tp->iss = tcp_rndiss_next();
|
||||
#endif /* TCP_COMPAT_42 */
|
||||
tcp_sendseqinit(tp);
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user