From 6c7be54e9bb56a4fb982d0ccf5ff7fc227a543c6 Mon Sep 17 00:00:00 2001 From: ps Date: Sun, 27 Feb 2005 20:39:04 +0000 Subject: 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 --- sys/netinet/tcp_sack.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sys') 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++; -- cgit v1.1