Fix a check in SYN cache expansion (syncache_expand()) to accept packets that arrive in the receive window instead of just on the left edge of the receive window.

This is needed for correct behavior when packets are lost or reordered.

PR:	kern/123950
Reviewed by:	andre@, silby@
Reported by:	Yahoo!, Wang Jin
MFC after:	1 week
This commit is contained in:
Stephan Uphoff 2008-06-16 19:56:59 +00:00
parent 8dce5c1bf6
commit 104ac85378

View File

@ -906,11 +906,14 @@ syncache_expand(struct in_conninfo *inc, struct tcpopt *to, struct tcphdr *th,
goto failed;
}
/*
* The SEQ must match the received initial receive sequence
* number + 1 (the SYN) because we didn't ACK any data that
* may have come with the SYN.
* The SEQ must fall in the window starting a the received initial receive
* sequence number + 1 (the SYN).
*/
if (th->th_seq != sc->sc_irs + 1 && !TOEPCB_ISSET(sc)) {
if ((SEQ_LEQ(th->th_seq, sc->sc_irs) ||
SEQ_GT(th->th_seq, sc->sc_irs + sc->sc_wnd )) &&
!TOEPCB_ISSET(sc))
{
if ((s = tcp_log_addrs(inc, th, NULL, NULL)))
log(LOG_DEBUG, "%s; %s: SEQ %u != IRS+1 %u, segment "
"rejected\n", s, __func__, th->th_seq, sc->sc_irs);