netdev
[Top] [All Lists]

Fwd: tcp seq nr wrapping bug + patch

To: <jmorris@xxxxxxxxxxxxxxxx>, <a@xxxxx>, <netdev@xxxxxxxxxxx>
Subject: Fwd: tcp seq nr wrapping bug + patch
From: "Ulrik De Bie" <ulrik.debie@xxxxxxxxx>
Date: Mon, 10 Mar 2003 16:16:13 +0100
Sender: netdev-bounce@xxxxxxxxxxx
Hello,

I resend this patch which fixes a stupid mistake in the tcp sequence number in 
the 2.2 kernel.

Kind regards,
Ulrik De Bie
--- Begin Message ---
To: <alan.cox@xxxxxxxxx>,<a@xxxxx>
Subject: tcp seq nr wrapping bug + patch
From: "Ulrik De Bie" <ulrik.debie@xxxxxxxxx>
Date: Wed, 11 Sep 2002 17:36:27 +0200
When the sequence number in a tcp session is about to wrap for packets
leaving the system, a problem arises:

When the system call writev is called, with a count of 5 for instance, and the
second iov entry makes the sequence number wrap, then the other 3 will be
sent in separate packets, because the comparison will be wrong.

before() fixes this problem.

Sorry that I'm sending from a windows machine at the moment, I don't have
a linux mail machine available at the very moment.

Kind regards,
Ulrik De Bie
udb@xxxxxxxxx




--- linux-2.2.21/net/ipv4/tcp.c Wed Sep 11 11:03:10 2002
+++ linux/net/ipv4/tcp.c        Wed Sep 11 17:27:53 2002
@@ -823,7 +823,7 @@
                                 */
                                if (skb_tailroom(skb) > 0 &&
                                    (mss_now - copy) > 0 &&
-                                   tp->snd_nxt < TCP_SKB_CB(skb)->end_seq) {
+                                   before(tp->snd_nxt , 
TCP_SKB_CB(skb)->end_seq)) {
                                        int last_byte_was_odd = (copy % 4);
 
                                        /* 



--- End Message ---
<Prev in Thread] Current Thread [Next in Thread>