diff options
author | ups <ups@FreeBSD.org> | 2008-06-16 19:56:59 +0000 |
---|---|---|
committer | ups <ups@FreeBSD.org> | 2008-06-16 19:56:59 +0000 |
commit | c8dbf3db604365bed1d33a5686b9b83fb23d6200 (patch) | |
tree | 1ac2753db8367daceb503be5b33614cb6894732a /sys/netinet/tcp_syncache.c | |
parent | c1f10cbbe7efb33d9820ecc95aaa8abd97356278 (diff) | |
download | FreeBSD-src-c8dbf3db604365bed1d33a5686b9b83fb23d6200.zip FreeBSD-src-c8dbf3db604365bed1d33a5686b9b83fb23d6200.tar.gz |
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
Diffstat (limited to 'sys/netinet/tcp_syncache.c')
-rw-r--r-- | sys/netinet/tcp_syncache.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet/tcp_syncache.c b/sys/netinet/tcp_syncache.c index e19f095..88b2c5e 100644 --- a/sys/netinet/tcp_syncache.c +++ b/sys/netinet/tcp_syncache.c @@ -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); |