patch-2.4.9 linux/net/ipv4/ip_sockglue.c

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

diff -u --recursive --new-file v2.4.8/linux/net/ipv4/ip_sockglue.c linux/net/ipv4/ip_sockglue.c
@@ -5,7 +5,7 @@
  *
  *		The IP to API glue.
  *		
- * Version:	$Id: ip_sockglue.c,v 1.56 2001/02/18 09:07:58 davem Exp $
+ * Version:	$Id: ip_sockglue.c,v 1.59 2001/08/13 18:56:12 davem Exp $
  *
  * Authors:	see ip.c
  *
@@ -43,8 +43,6 @@
 #include <linux/errqueue.h>
 #include <asm/uaccess.h>
 
-#define MAX(a,b) ((a)>(b)?(a):(b))
-
 #define IP_CMSG_PKTINFO		1
 #define IP_CMSG_TTL		2
 #define IP_CMSG_TOS		4
@@ -685,7 +683,7 @@
 
 				ip_options_undo(opt);
 
-				len=min(len, opt->optlen);
+				len = min(unsigned int, len, opt->optlen);
 				if(put_user(len, optlen))
 					return -EFAULT;
 				if(copy_to_user(optval, opt->__data, len))
@@ -746,7 +744,7 @@
 		case IP_MULTICAST_IF:
 		{
 			struct in_addr addr;
-			len = min(len,sizeof(struct in_addr));
+			len = min(unsigned int, len, sizeof(struct in_addr));
 			addr.s_addr = sk->protinfo.af_inet.mc_addr;
 			release_sock(sk);
 
@@ -810,7 +808,7 @@
 		if(copy_to_user(optval,&ucval,1))
 			return -EFAULT;
 	} else {
-		len=min(sizeof(int),len);
+		len = min(unsigned int, sizeof(int), len);
 		if(put_user(len, optlen))
 			return -EFAULT;
 		if(copy_to_user(optval,&val,len))

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)