浏览代码

tcp: Fix tcp_mark_head_lost() with packets == 0

A packet is marked as lost in case packets == 0, although nothing should be done.
This results in a too early retransmitted packet during recovery in some cases.
This small patch fixes this issue by returning immediately.

Signed-off-by: Lennart Schulte <lennart.schulte@nets.rwth-aachen.de>
Signed-off-by: Arnd Hannemann <hannemann@nets.rwth-aachen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Lennart Schulte 15 年之前
父节点
当前提交
6830c25b7d
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      net/ipv4/tcp_input.c

+ 3 - 0
net/ipv4/tcp_input.c

@@ -2511,6 +2511,9 @@ static void tcp_mark_head_lost(struct sock *sk, int packets)
 	int err;
 	int err;
 	unsigned int mss;
 	unsigned int mss;
 
 
+	if (packets == 0)
+		return;
+
 	WARN_ON(packets > tp->packets_out);
 	WARN_ON(packets > tp->packets_out);
 	if (tp->lost_skb_hint) {
 	if (tp->lost_skb_hint) {
 		skb = tp->lost_skb_hint;
 		skb = tp->lost_skb_hint;