netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Fwd: tcp seq nr wrapping bug + patch
@ 2003-03-10 15:16 Ulrik De Bie
  2003-03-11 12:40 ` James Morris
  0 siblings, 1 reply; 2+ messages in thread
From: Ulrik De Bie @ 2003-03-10 15:16 UTC (permalink / raw)
  To: jmorris, a, netdev

[-- Attachment #1: Type: text/plain, Size: 137 bytes --]

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

[-- Attachment #2: Type: message/rfc822, Size: 1205 bytes --]

From: "Ulrik De Bie" <ulrik.debie@newtec.be>
To: <alan.cox@linux.org>,<a@oo.ms>
Subject: tcp seq nr wrapping bug + patch
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@newtec.be




--- 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);
 
 					/* 



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Fwd: tcp seq nr wrapping bug + patch
  2003-03-10 15:16 Fwd: tcp seq nr wrapping bug + patch Ulrik De Bie
@ 2003-03-11 12:40 ` James Morris
  0 siblings, 0 replies; 2+ messages in thread
From: James Morris @ 2003-03-11 12:40 UTC (permalink / raw)
  To: Alan Cox; +Cc: Ulrik De Bie, a, netdev

On Mon, 10 Mar 2003, Ulrik De Bie wrote:

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

This looks good, thanks.

Alan, please apply.


- James
-- 
James Morris
<jmorris@intercode.com.au>


diff -urN -X dontdiff linux-2.2.24.orig/net/ipv4/tcp.c linux-2.2.24.w1/net/ipv4/tcp.c
--- linux-2.2.24.orig/net/ipv4/tcp.c	Wed Sep 25 00:06:26 2002
+++ linux-2.2.24.w1/net/ipv4/tcp.c	Tue Mar 11 23:26:00 2003
@@ -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);
 
 					/* 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-03-11 12:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-10 15:16 Fwd: tcp seq nr wrapping bug + patch Ulrik De Bie
2003-03-11 12:40 ` James Morris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).