aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/ipv6_sockglue.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ipv6_sockglue.c')
-rw-r--r--net/ipv6/ipv6_sockglue.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index d6846393182..6b038aa72e8 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -554,6 +554,10 @@ done:
554 { 554 {
555 struct ipv6_mreq mreq; 555 struct ipv6_mreq mreq;
556 556
557 retv = -EPROTO;
558 if (inet_sk(sk)->is_icsk)
559 break;
560
557 retv = -EFAULT; 561 retv = -EFAULT;
558 if (copy_from_user(&mreq, optval, sizeof(struct ipv6_mreq))) 562 if (copy_from_user(&mreq, optval, sizeof(struct ipv6_mreq)))
559 break; 563 break;
@@ -820,7 +824,7 @@ static int ipv6_getsockopt_sticky(struct sock *sk, struct ipv6_txoptions *opt,
820 return 0; 824 return 0;
821 825
822 len = min_t(unsigned int, len, ipv6_optlen(hdr)); 826 len = min_t(unsigned int, len, ipv6_optlen(hdr));
823 if (copy_to_user(optval, hdr, len)); 827 if (copy_to_user(optval, hdr, len))
824 return -EFAULT; 828 return -EFAULT;
825 return ipv6_optlen(hdr); 829 return ipv6_optlen(hdr);
826} 830}