patch-2.1.28 linux/net/ipv4/ip_sockglue.c
Next file: linux/net/ipv4/packet.c
Previous file: linux/net/ipv4/ip_input.c
Back to the patch index
Back to the overall index
- Lines: 25
- Date:
Mon Mar 3 09:37:44 1997
- Orig file:
v2.1.27/linux/net/ipv4/ip_sockglue.c
- Orig date:
Thu Feb 27 10:57:32 1997
diff -u --recursive --new-file v2.1.27/linux/net/ipv4/ip_sockglue.c linux/net/ipv4/ip_sockglue.c
@@ -171,17 +171,17 @@
{
int val=0,err;
unsigned char ucval = 0;
- int len;
#if defined(CONFIG_IP_FIREWALL) || defined(CONFIG_IP_ACCT)
struct ip_fw tmp_fw;
#endif
- if(get_user(len, optval))
- return -EFAULT;
- if(len>=sizeof(int) && get_user(val, (int *) optval))
- return -EFAULT;
- if(len>=sizeof(char) && get_user(ucval, (unsigned char *) optval))
- return -EFAULT;
+ if(optlen>=sizeof(int)) {
+ if(get_user(val, (int *) optval))
+ return -EFAULT;
+ } else if(optlen>=sizeof(char)) {
+ if(get_user(ucval, (unsigned char *) optval))
+ return -EFAULT;
+ }
if(level!=SOL_IP)
return -ENOPROTOOPT;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov