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

Next file: linux/net/ethernet/eth.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.35/linux/net/core/sock.c linux/net/core/sock.c
@@ -189,7 +189,7 @@
 			 *	is best
 			 */
 			 
-			if(val > SK_WMEM_MAX*2 || val < 2048)
+			if(val > SK_WMEM_MAX*2)
 				return -EINVAL;
 			/*
 			 *	Once this is all 32bit values we can
@@ -197,7 +197,7 @@
 			 */
 			if(val > 65535)
 				return -EINVAL;
-			sk->sndbuf = val;
+			sk->sndbuf = max(val,2048);
 			/*
 			 *	Wake up sending tasks if we
 			 *	upped the value.
@@ -206,12 +206,12 @@
 			break;
 
 		case SO_RCVBUF:
-			if(val > SK_RMEM_MAX*2 || val < 256)
+			if(val > SK_RMEM_MAX*2)
 				return -EINVAL;
 			/* Can go soon: FIXME */
 			if(val > 65535)
 				return -EINVAL;
-			sk->rcvbuf = val;
+			sk->rcvbuf = max(val,256);
 			break;
 
 		case SO_KEEPALIVE:
@@ -479,9 +479,6 @@
 void sock_wfree(struct sk_buff *skb)
 {
 	struct sock *sk = skb->sk;
-#if CONFIG_SKB_CHECK
-	IS_SKB(skb);
-#endif
 #if 1
 	if (!sk) {
 		printk(KERN_DEBUG "sock_wfree: sk==NULL\n");
@@ -497,9 +494,6 @@
 void sock_rfree(struct sk_buff *skb)
 {
 	struct sock *sk = skb->sk;
-#if CONFIG_SKB_CHECK
-	IS_SKB(skb);
-#endif	
 #if 1
 	if (!sk) {
 		printk(KERN_DEBUG "sock_rfree: sk==NULL\n");

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