patch-2.1.28 linux/net/ipv4/tcp.c

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

diff -u --recursive --new-file v2.1.27/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
@@ -817,6 +817,7 @@
 		
 		if (sk->state != TCP_SYN_SENT && sk->state != TCP_SYN_RECV)
 		{
+			printk("tcp_do_sendmsg1: EPIPE dude...\n");
 			if (sk->keepopen)
 				send_sig(SIGPIPE, current, 0);
 			return -EPIPE;
@@ -869,6 +870,7 @@
 			{
 				if (copied)
 					return copied;
+				printk("tcp_do_sendmsg2: SEND_SHUTDOWN, EPIPE...\n");
 				send_sig(SIGPIPE,current,0);
 				return -EPIPE;
 			}
@@ -1613,7 +1615,6 @@
 
 	lock_sock(sk);
 
-	tcp_cache_zap();
 	if(sk->state == TCP_LISTEN)
 	{
 		/* Special case */
@@ -1621,6 +1622,7 @@
 		tcp_close_pending(sk);
 		release_sock(sk);
 		sk->dead = 1;
+		sk->prot->unhash(sk);
 		return;
 	}
 
@@ -1667,12 +1669,6 @@
 		sti();
 	}
 
-	/*
-	 * This will destroy it. The timers will take care of actually
-	 * free'ing up the memory.
-	 */
-	tcp_cache_zap();	/* Kill the cache again. */
-
 	/* Now that the socket is dead, if we are in the FIN_WAIT2 state
 	 * we may need to set up a timer.
          */
@@ -1687,6 +1683,9 @@
 
 	release_sock(sk);
 	sk->dead = 1;
+
+	if(sk->state == TCP_CLOSE)
+		sk->prot->unhash(sk);
 }
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov