patch-1.3.30 linux/net/ipv4/af_inet.c

Next file: linux/net/ipv4/icmp.c
Previous file: linux/net/ipv4/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.29/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
@@ -381,6 +381,13 @@
 
 	if (sk->dead && sk->rmem_alloc == 0 && sk->wmem_alloc == 0) 
 	{
+		if(sk->opt)
+			kfree(sk->opt);
+		/*
+		 *	This one is pure paranoia. I'll take it out
+		 *	later once I know the bug is buried.
+		 */
+		tcp_cache_zap();
 		kfree_s((void *)sk,sizeof(*sk));
 	} 
 	else 
@@ -848,7 +855,13 @@
 
 	/* This will destroy it. */
 	sock->data = NULL;
+	/* 
+	 *	Nasty here. release_sock can cause more frames
+	 *	to be played through the socket. That can
+	 *	reinitialise the tcp cache after tcp_close();
+	 */
 	release_sock(sk);
+	tcp_cache_zap();	/* Kill the cache again. */
 	sk->socket = NULL;
 	return(0);
 }
@@ -1104,7 +1117,7 @@
 	if (sk2->state != TCP_ESTABLISHED && sk2->err > 0) 
 	{
 		err = inet_error(sk2);
-		sk2->dead=1;			/* ANK */
+		sk2->dead=1;
 		destroy_sock(sk2);
 		newsock->data = NULL;
 		return err;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this