Skip to content

Commit 09db794

Browse files
Xin GuoNipaLocal
authored andcommitted
tcp: correct the skip logic in tcp_sacktag_skip()
tcp_sacktag_skip() directly return the input skb only if TCP_SKB_CB(skb)->seq>skip_to_seq, this is not right, and the logic should be TCP_SKB_CB(skb)->seq>=skip_to_seq, for example if start_seq is equal to tcp_highest_sack_seq() , the start_seq is equal to seq of skb which is from tcp_highest_sack(). and on the other side ,when tcp_highest_sack_seq() < start_seq in tcp_sacktag_write_queue(), the skb is from tcp_highest_sack() will be ignored in tcp_sacktag_skip(), so clean the logic also. Fixes: 75c119a ("tcp: implement rb-tree based retransmit queue") Signed-off-by: Xin Guo <guoxin0309@gmail.com> Signed-off-by: NipaLocal <nipa@local>
1 parent 98a7d6d commit 09db794

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/ipv4/tcp_input.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,7 +1809,7 @@ static struct sk_buff *tcp_sacktag_bsearch(struct sock *sk, u32 seq)
18091809
static struct sk_buff *tcp_sacktag_skip(struct sk_buff *skb, struct sock *sk,
18101810
u32 skip_to_seq)
18111811
{
1812-
if (skb && after(TCP_SKB_CB(skb)->seq, skip_to_seq))
1812+
if (skb && !before(TCP_SKB_CB(skb)->seq, skip_to_seq))
18131813
return skb;
18141814

18151815
return tcp_sacktag_bsearch(sk, skip_to_seq);
@@ -1997,7 +1997,7 @@ tcp_sacktag_write_queue(struct sock *sk, const struct sk_buff *ack_skb,
19971997
continue;
19981998
}
19991999

2000-
if (!before(start_seq, tcp_highest_sack_seq(tp))) {
2000+
if (tcp_highest_sack_seq(tp) == start_seq) {
20012001
skb = tcp_highest_sack(sk);
20022002
if (!skb)
20032003
break;

0 commit comments

Comments
 (0)