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