]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ipv6 mcast: Check address family of gf_group in getsockopt(MS_FILTER).
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Mon, 28 Apr 2008 05:40:55 +0000 (14:40 +0900)
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Thu, 12 Jun 2008 00:19:08 +0000 (09:19 +0900)
Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
net/ipv6/ipv6_sockglue.c

index 26b83e512a0922d86c38144a1c53052b0163eed7..ce794d6acb708a4d78765e00a039a0b27a3bc7b5 100644 (file)
@@ -874,6 +874,8 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname,
                        return -EINVAL;
                if (copy_from_user(&gsf, optval, GROUP_FILTER_SIZE(0)))
                        return -EFAULT;
+               if (gsf.gf_group.ss_family != AF_INET6)
+                       return -EADDRNOTAVAIL;
                lock_sock(sk);
                err = ip6_mc_msfget(sk, &gsf,
                        (struct group_filter __user *)optval, optlen);