BUG in tcp_timer.c:tcp_retransmit_timer() (fwd)

From: Nagendra Singh Tomar
Date: Mon Mar 29 2004 - 06:34:56 EST

Forgot to mention the kernel version.
I am using 2.4.18 but I have seen it at least till 2.6.0.


---------- Forwarded message ----------
Date: Mon, 29 Mar 2004 02:39:01 +0530 (IST)
From: Nagendra Singh Tomar <nagendra_tomar@xxxxxxxxxxx>
To: linux-net@xxxxxxxxxxxxxxx
Cc: "Tomar, Nagendra" <nagendra_tomar@xxxxxxxxxxx>
Subject: BUG in tcp_timer.c:tcp_retransmit_timer()

While reading the code of tcp_retransmit_timer(), I came across something
which looks liks a BUG.

The following line

if (tcp_retransmit_skb(sk, skb_peek(&sk->write_queue)) > 0)

should correctly read as

if (tcp_retransmit_skb(sk, skb_peek(&sk->write_queue)) < 0)

Note the check for error condition errorneously done as '> 0'

The bad effects that could be introduced due to this BUG, might be lesser
number of retransmissions (actual retransmissions on the wire) before the
TCP timeout. In the (unlikely) worst case we might end up timing out the
connection without a single retransmission on the wire,


PS: Please copy to my email-id as I am not able to access the list,

-- You have moved the mouse. Windows must be restarted for the
changes to take effect.

To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html