[6] in linux-net channel archive

home help back first fref pref prev next nref lref last post

Re: .65-.72 to .73 problems go away

daemon@ATHENA.MIT.EDU (Linus Torvalds)
Mon Dec 19 12:31:59 1994

Date: Mon, 19 Dec 1994 18:14:39 +0200
From: Linus Torvalds <Linus.Torvalds@cs.helsinki.fi>
In-Reply-To: lilo's message as of Dec 19,  9:57
To: lilo <TaRDiS@mail.utexas.edu>, Brian Edmonds <edmonds@cs.ubc.ca>
Cc: linux-kernel@vger.rutgers.edu, linux-net@vger.rutgers.edu

lilo: "Re: .65-.72 to .73 problems go away" (Dec 19,  9:57):
> On Mon, 19 Dec 1994, Brian Edmonds wrote:
> 
> > >>>>> On Sun, 18 Dec 1994, lilo <TaRDiS@mail.utexas.edu> said:
> > 
> > l> Some of the tcp.c code was completely rewritten between 1.1.72 and
> > l> 1.1.73.  I think Alan plans to rewrite more of it.
> > 
> > I hope so.  As someone else (I forget who) pointed out here, p73 is
> > resulting in a lot of hung sockets for me.  This reminds of the old days
> > of 0.99.13 before I added Fred's net2e patches, when I had to reboot
> > every day to clean up the jammed sockets.  Say what you will of Fred's
> > work, but it was a real lifesaver for me at the time -- kept me going
> > right up until I upgraded to 1.1.36...
> 
> I think we'd probably have seen a patch much more quickly, but for the 
> time of year.  As I understand it, Alan is out until the beginning of 
> the year, and I'm sure we'll see another patch sometime soon 
> thereafter....  The jammed sockets are a known problem with 1.1.73....

We'll see what happens, but people seeing problems with 1.1.73 could try
this patch to tcp.c: it fixes a timer problem and a some details with
the TIME_WAIT socket re-use. 

		Linus

----------
diff -u --recursive --new-file v1.1.73/linux/net/inet/tcp.c linux/net/inet/tcp.c
--- v1.1.73/linux/net/inet/tcp.c	Thu Dec 15 11:01:58 1994
+++ linux/net/inet/tcp.c	Mon Dec 19 18:04:50 1994
@@ -3291,10 +3291,15 @@
 			 * happens, we must ack the received FIN and
 			 * enter the CLOSING state.
 			 *
-			 * XXX timeout not set properly
+			 * This causes a WRITE timeout, which will either
+			 * move on to TIME_WAIT when we timeout, or resend
+			 * the FIN properly (maybe we get rid of that annoying
+			 * FIN lost hang). The TIME_WRITE code is already correct
+			 * for handling this timeout.
 			 */
 
-			reset_timer(sk, TIME_CLOSE, TCP_TIMEWAIT_LEN);
+			if(sk->timeout != TIME_WRITE)
+				reset_timer(sk, TIME_WRITE, sk->rto);
 			tcp_set_state(sk,TCP_CLOSING);
 			break;
 		case TCP_FIN_WAIT2:
@@ -4320,14 +4325,18 @@
 		if(sk->debug)
 			printk("Doing a BSD time wait\n");
 		tcp_statistics.TcpEstabResets++;	   
+		sk->rmem_alloc -= skb->mem_len;
+		skb->sk = NULL;
 		sk->err=ECONNRESET;
 		tcp_set_state(sk, TCP_CLOSE);
 		sk->shutdown = SHUTDOWN_MASK;
 		release_sock(sk);
-		sk=get_sock(&tcp_prot, th->source, daddr, th->dest, saddr);
+		sk=get_sock(&tcp_prot, th->dest, saddr, th->source, daddr);
 		if(sk && sk->state==TCP_LISTEN)
 		{
 			sk->inuse=1;
+			skb->sk = sk;
+			sk->rmem_alloc += skb->mem_len;
 			tcp_conn_request(sk, skb, daddr, saddr,opt, dev,seq+128000);
 			release_sock(sk);
 			return 0;
----------

home help back first fref pref prev next nref lref last post