From 7776346f831f03c57144a989f036aeac0f43ef6e Mon Sep 17 00:00:00 2001 From: Paul Saab Date: Wed, 16 Feb 2005 01:46:17 +0000 Subject: [PATCH] Fix for a SACK (receiver) bug where incorrect SACK blocks are reported to the sender - in the case where the sender sends data outside the window (as WinXP does :(). Reported by: Sam Jensen Submitted by: Mohan Srinivasan --- sys/netinet/tcp_input.c | 9 +++++---- sys/netinet/tcp_reass.c | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 178455148852..c10a94c4b8b1 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1102,8 +1102,6 @@ tcp_input(m, off0) if (tp->sack_enable) { /* Delete stale (cumulatively acked) SACK holes */ tcp_del_sackholes(tp, th); - tp->rcv_laststart = th->th_seq; /* last recv'd segment*/ - tp->rcv_lastend = th->th_seq + tlen; } /* @@ -2297,8 +2295,11 @@ tcp_input(m, off0) thflags = tcp_reass(tp, th, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if (tp->sack_enable) - tcp_update_sack_list(tp); + if (tp->sack_enable) { + tp->rcv_laststart = th->th_seq; /* last recv'd segment*/ + tp->rcv_lastend = th->th_seq + tlen; + tcp_update_sack_list(tp); + } /* * Note the amount of data that peer has sent into * our window, in order to estimate the sender's diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c index 178455148852..c10a94c4b8b1 100644 --- a/sys/netinet/tcp_reass.c +++ b/sys/netinet/tcp_reass.c @@ -1102,8 +1102,6 @@ tcp_input(m, off0) if (tp->sack_enable) { /* Delete stale (cumulatively acked) SACK holes */ tcp_del_sackholes(tp, th); - tp->rcv_laststart = th->th_seq; /* last recv'd segment*/ - tp->rcv_lastend = th->th_seq + tlen; } /* @@ -2297,8 +2295,11 @@ tcp_input(m, off0) thflags = tcp_reass(tp, th, &tlen, m); tp->t_flags |= TF_ACKNOW; } - if (tp->sack_enable) - tcp_update_sack_list(tp); + if (tp->sack_enable) { + tp->rcv_laststart = th->th_seq; /* last recv'd segment*/ + tp->rcv_lastend = th->th_seq + tlen; + tcp_update_sack_list(tp); + } /* * Note the amount of data that peer has sent into * our window, in order to estimate the sender's