Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 276c4c69ed5efcebe43ee6121194cf59 > files > 52

kernel22-2.2.20-9mdk.src.rpm

diff -urN 2.2.18pre14/net/ipv4/tcp.c cksum-unlock/net/ipv4/tcp.c
--- 2.2.18pre14/net/ipv4/tcp.c	Mon Oct  2 22:28:16 2000
+++ cksum-unlock/net/ipv4/tcp.c	Mon Oct  2 23:53:43 2000
@@ -416,6 +416,8 @@
 #include <linux/fcntl.h>
 #include <linux/poll.h>
 #include <linux/init.h>
+#include <linux/smp_lock.h>
+#include <linux/condsched.h>
 
 #include <net/icmp.h>
 #include <net/tcp.h>
@@ -767,6 +769,7 @@
 	int iovlen, flags;
 	int mss_now;
 	int err, copied;
+	DECLARE_LOCAL_LOCK_DEPTH(lock_depth);
 
 	lock_sock(sk);
 
@@ -848,10 +851,13 @@
 						skb->csum = csum_partial(skb->data,
 									 skb->len, 0);
 					} else {
+						release_kernel_lock_save(lock_depth);
 						skb->csum =
 							csum_and_copy_from_user(
 							from, skb_put(skb, copy),
 							copy, skb->csum, &err);
+						conditional_schedule();
+						reacquire_kernel_lock_restore(lock_depth);
 					}
 		
 					/*
@@ -966,8 +972,11 @@
 			 * Reserve header space and checksum the data.
 			 */
 			skb_reserve(skb, MAX_HEADER + sk->prot->max_header);
+			release_kernel_lock_save(lock_depth);
 			skb->csum = csum_and_copy_from_user(from,
 					skb_put(skb, copy), copy, 0, &err);
+			conditional_schedule();
+			reacquire_kernel_lock_restore(lock_depth);
 
 			if (err)
 				goto do_fault;