summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-28 14:00:27 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-03-28 14:00:27 -0700
commitc203b33d2ee34594f6656c033cddd4f5860eb06c (patch)
treeb59fec34142a6d99df85a0d3576bdf7249308e07
parenta26b5fce06b92b2f02967d4c845fa628024e5414 (diff)
parent39ebc0276bada8bb70e067cb6d0eb71839c0fb08 (diff)
downloadlinux-stable-c203b33d2ee34594f6656c033cddd4f5860eb06c.tar.gz
linux-stable-c203b33d2ee34594f6656c033cddd4f5860eb06c.tar.bz2
linux-stable-c203b33d2ee34594f6656c033cddd4f5860eb06c.zip
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [DCCP] getsockopt: Fix DCCP_SOCKOPT_[SEND,RECV]_CSCOV
-rw-r--r--net/dccp/proto.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index cf28c53a389a..6607b7b14f34 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -575,7 +575,7 @@ static int do_dccp_getsockopt(struct sock *sk, int level, int optname,
if (get_user(len, optlen))
return -EFAULT;
- if (len < sizeof(int))
+ if (len < (int)sizeof(int))
return -EINVAL;
dp = dccp_sk(sk);
@@ -589,9 +589,11 @@ static int do_dccp_getsockopt(struct sock *sk, int level, int optname,
(__be32 __user *)optval, optlen);
case DCCP_SOCKOPT_SEND_CSCOV:
val = dp->dccps_pcslen;
+ len = sizeof(val);
break;
case DCCP_SOCKOPT_RECV_CSCOV:
val = dp->dccps_pcrlen;
+ len = sizeof(val);
break;
case 128 ... 191:
return ccid_hc_rx_getsockopt(dp->dccps_hc_rx_ccid, sk, optname,