aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv6/ipv6_sockglue.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index eceed09e434d..1d56b465bddb 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -825,9 +825,9 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
825 return 0; 825 return 0;
826 826
827 len = min_t(unsigned int, len, ipv6_optlen(hdr)); 827 len = min_t(unsigned int, len, ipv6_optlen(hdr));
828 if (copy_to_user(optval, hdr, ipv6_optlen(hdr))) 828 if (copy_to_user(optval, hdr, len));
829 return -EFAULT; 829 return -EFAULT;
830 return len; 830 return ipv6_optlen(hdr);
831} 831}
832 832
833static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, 833static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,