aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYang Hongyang <yanghy@cn.fujitsu.com>2008-05-28 04:27:28 -0400
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-06-04 15:02:35 -0400
commit95b496b66615d8c43f77702049b1bd01e2f06595 (patch)
tree5e0dc14f6bb3f13b6446fef52916ed3a07dca12b /net
parent05335c2220c4911b69cb1bdd79e603ab08088372 (diff)
[IPV6]: Fix the data length of get destination options with short length
If get destination options with length which is not enough for that option,getsockopt() will still return the real length of the option, which is larger then the buffer space. This is because ipv6_getsockopt_sticky() returns the real length of the option. This patch fix this problem. Signed-off-by: Yang Hongyang <yanghy@cn.fujitsu.com> Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ipv6_sockglue.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index aa7bedf780e5..9293b9f0ac23 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -832,7 +832,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
832 len = min_t(unsigned int, len, ipv6_optlen(hdr)); 832 len = min_t(unsigned int, len, ipv6_optlen(hdr));
833 if (copy_to_user(optval, hdr, len)) 833 if (copy_to_user(optval, hdr, len))
834 return -EFAULT; 834 return -EFAULT;
835 return ipv6_optlen(hdr); 835 return len;
836} 836}
837 837
838static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, 838static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,