patch-2.1.112 linux/net/core/sock.c

Next file: linux/net/econet/econet.c
Previous file: linux/net/core/skbuff.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.111/linux/net/core/sock.c linux/net/core/sock.c
@@ -105,6 +105,7 @@
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/poll.h>
+#include <linux/init.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
@@ -212,7 +213,7 @@
 			   are treated in BSD as hints */
 			   
 			if (val > sysctl_wmem_max)
-				return 0;
+				val = sysctl_wmem_max;
 
 			sk->sndbuf = max(val*2,2048);
 
@@ -230,7 +231,7 @@
 			   are treated in BSD as hints */
 			  
 			if (val > sysctl_rmem_max)
-				return 0;
+				val = sysctl_rmem_max;
 
 			/* FIXME: is this lower bound the right one? */
 			sk->rcvbuf = max(val*2,256);
@@ -495,10 +496,11 @@
 	kmem_cache_free(sk_cachep, sk);
 }
 
-void sk_init(void)
+__initfunc(void sk_init(void))
 {
 	sk_cachep = kmem_cache_create("sock", sizeof(struct sock), 0,
 				      SLAB_HWCACHE_ALIGN, 0, 0);
+
 }
 
 /*

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