summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2005-02-27 20:39:04 +0000
committerps <ps@FreeBSD.org>2005-02-27 20:39:04 +0000
commit6c7be54e9bb56a4fb982d0ccf5ff7fc227a543c6 (patch)
tree4e3f456407170c887e157c1bf94eb8f559cf532d /sys/netinet
parentf8ec83d9049d4c76c2b9f5a8e74f0b6814c5f481 (diff)
downloadFreeBSD-src-6c7be54e9bb56a4fb982d0ccf5ff7fc227a543c6.zip
FreeBSD-src-6c7be54e9bb56a4fb982d0ccf5ff7fc227a543c6.tar.gz
If the receiver sends an ack that is out of [snd_una, snd_max],
ignore the sack options in that segment. Else we'd end up corrupting the scoreboard. Found by: Raja Mukerji (raja at moselle dot com) Submitted by: Mohan Srinivasan
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/tcp_sack.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/netinet/tcp_sack.c b/sys/netinet/tcp_sack.c
index afedbdf..31d69eb 100644
--- a/sys/netinet/tcp_sack.c
+++ b/sys/netinet/tcp_sack.c
@@ -301,6 +301,9 @@ tcp_sack_option(struct tcpcb *tp, struct tcphdr *th, u_char *cp, int optlen)
/* Note: TCPOLEN_SACK must be 2*sizeof(tcp_seq) */
if (optlen <= 2 || (optlen - 2) % TCPOLEN_SACK != 0)
return (1);
+ /* If ack is outside window, ignore the SACK options */
+ if (SEQ_LT(th->th_ack, tp->snd_una) || SEQ_GT(th->th_ack, tp->snd_max))
+ return (1);
tmp_cp = cp + 2;
tmp_olen = optlen - 2;
tcpstat.tcps_sack_rcv_blocks++;
OpenPOWER on IntegriCloud