1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-30 16:51:41 +00:00

TCP Window scaling was being recognised but the recorded settings were being

clobbered and thus effectively disabled.

MFC after:	7 days
This commit is contained in:
Darren Reed 2006-12-24 02:18:36 +00:00
parent 83e3f6ad3e
commit 4012ba6ec7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=165515

View File

@ -1358,21 +1358,16 @@ ipstate_t *is;
if (flags == (TH_SYN|TH_ACK)) {
is->is_s0[source] = ntohl(tcp->th_ack);
is->is_s0[!source] = ntohl(tcp->th_seq) + 1;
if ((TCP_OFF(tcp) > (sizeof(tcphdr_t) >> 2)) &&
(tdata->td_winflags & TCP_WSCALE_SEEN)) {
if ((TCP_OFF(tcp) > (sizeof(tcphdr_t) >> 2))) {
if (fr_tcpoptions(fin, tcp, fdata) == -1)
fin->fin_flx |= FI_BAD;
if (!(fdata->td_winflags & TCP_WSCALE_SEEN)) {
fdata->td_winscale = 0;
tdata->td_winscale = 0;
}
}
if ((fin->fin_out != 0) && (is->is_pass & FR_NEWISN))
fr_checknewisn(fin, is);
} else if (flags == TH_SYN) {
is->is_s0[source] = ntohl(tcp->th_seq) + 1;
if ((TCP_OFF(tcp) > (sizeof(tcphdr_t) >> 2))) {
if (fr_tcpoptions(fin, tcp, tdata) == -1)
if (fr_tcpoptions(fin, tcp, fdata) == -1)
fin->fin_flx |= FI_BAD;
}
@ -1479,17 +1474,8 @@ int flags;
* the receiver also does window scaling)
*/
if (!(tcpflags & TH_SYN) && (fdata->td_winflags & TCP_WSCALE_FIRST)) {
if (tdata->td_winflags & TCP_WSCALE_SEEN) {
fdata->td_winflags &= ~TCP_WSCALE_FIRST;
fdata->td_maxwin = win;
} else {
fdata->td_winscale = 0;
fdata->td_winflags &= ~(TCP_WSCALE_FIRST|
TCP_WSCALE_SEEN);
tdata->td_winscale = 0;
tdata->td_winflags &= ~(TCP_WSCALE_FIRST|
TCP_WSCALE_SEEN);
}
fdata->td_winflags &= ~TCP_WSCALE_FIRST;
fdata->td_maxwin = win;
}
end = seq + dsize;
@ -1532,7 +1518,7 @@ int flags;
(SEQ_GE(seq, fdata->td_end - maxwin)) &&
/* XXX what about big packets */
#define MAXACKWINDOW 66000
(-ackskew <= (MAXACKWINDOW << fdata->td_winscale)) &&
(-ackskew <= (MAXACKWINDOW)) &&
( ackskew <= (MAXACKWINDOW << fdata->td_winscale))) {
inseq = 1;
/*
@ -1578,6 +1564,8 @@ int flags;
}
}
/* TRACE(inseq, fdata, tdata, seq, end, ack, ackskew, win, maxwin) */
if (inseq) {
/* if ackskew < 0 then this should be due to fragmented
* packets. There is no way to know the length of the