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

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

diff -u --recursive --new-file v2.1.24/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
@@ -799,6 +799,7 @@
 int tcp_do_sendmsg(struct sock *sk, int iovlen, struct iovec *iov,
 		   int len, int flags)
 {
+	int err = 0;
 	int copied  = 0;
 	struct tcp_opt *tp=&(sk->tp_pinfo.af_tcp);
 
@@ -849,6 +850,8 @@
 			int tmp;
 			struct sk_buff *skb;
 
+			if (err)
+				return (err);
 			/*
 			 * Stop on errors
 			 */
@@ -1030,7 +1033,7 @@
 				skb->h.th->urg_ptr = ntohs(copy);
 			}
 
-			skb->csum = csum_partial_copy_fromuser(from,
+			skb->csum = csum_partial_copy_from_user(&err, from,
 					skb_put(skb, copy), copy, 0);
 		
 			from += copy;
@@ -1044,6 +1047,9 @@
 
 	sk->err = 0;
 
+	if (err)
+		return (err);
+
 	return copied;
 }
 
@@ -1124,7 +1130,7 @@
 						       msg->msg_name);       
 		}
 		if(addr_len)
-			*addr_len= tp->af_specific->sockaddr_len;
+			*addr_len = tp->af_specific->sockaddr_len;
 		/* 
 		 *	Read urgent data
 		 */
@@ -1173,14 +1179,14 @@
 			break;
 		tcp_eat_skb(sk, skb);
 	}
-
+       
 	SOCK_DEBUG(sk, "sk->rspace = %lu\n", sock_rspace(sk));
-
-	/*
-	 *  We send a ACK if the sender is blocked
-	 *  else let tcp_data deal with the acking policy.
-	 */
-
+	
+  	/*
+  	 *  We send a ACK if the sender is blocked
+  	 *  else let tcp_data deal with the acking policy.
+  	 */
+  
 	if (sk->delayed_acks)
 	{
 		struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp);
@@ -1456,7 +1462,7 @@
 					       msg->msg_name);       
 	}
 	if(addr_len)
-		*addr_len = tp->af_specific->sockaddr_len;
+		*addr_len= tp->af_specific->sockaddr_len;
 
 	remove_wait_queue(sk->sleep, &wait);
 	current->state = TASK_RUNNING;

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