aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
authorBaruch Even <baruch@ev-en.org>2007-02-05 02:37:41 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-08 15:38:50 -0500
commit8a3c3a972741dec77220a19642bd3331551ad2d9 (patch)
tree067787f9faef7ada3d0096742f79a930ec808357 /net/ipv4/tcp_input.c
parent6f74651ae626ec672028587bc700538076dfbefb (diff)
[TCP]: Check num sacks in SACK fast path
We clear the unused parts of the SACK cache, This prevents us from mistakenly taking the cache data if the old data in the SACK cache is the same as the data in the SACK block. This assumes that we never receive an empty SACK block with start and end both at zero. Signed-off-by: Baruch Even <baruch@ev-en.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 870f53afd363..c6109895bb5e 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -998,6 +998,11 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_
998 tp->recv_sack_cache[i].start_seq = start_seq; 998 tp->recv_sack_cache[i].start_seq = start_seq;
999 tp->recv_sack_cache[i].end_seq = end_seq; 999 tp->recv_sack_cache[i].end_seq = end_seq;
1000 } 1000 }
1001 /* Clear the rest of the cache sack blocks so they won't match mistakenly. */
1002 for (; i < ARRAY_SIZE(tp->recv_sack_cache); i++) {
1003 tp->recv_sack_cache[i].start_seq = 0;
1004 tp->recv_sack_cache[i].end_seq = 0;
1005 }
1001 1006
1002 first_sack_index = 0; 1007 first_sack_index = 0;
1003 if (flag) 1008 if (flag)