Commit 28d44882 authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki

ipv6: Check IPV6_MULTICAST_LOOP option value.

Only 0 and 1 are valid for IPV6_MULTICAST_LOOP socket option,
and we should return an error of EINVAL otherwise, per RFC3493.

Based on patch from Shan Wei <shanwei@cn.fujitsu.com>.
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
parent e8766fc8
...@@ -458,6 +458,8 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname, ...@@ -458,6 +458,8 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
case IPV6_MULTICAST_LOOP: case IPV6_MULTICAST_LOOP:
if (optlen < sizeof(int)) if (optlen < sizeof(int))
goto e_inval; goto e_inval;
if (val != valbool)
goto e_inval;
np->mc_loop = valbool; np->mc_loop = valbool;
retv = 0; retv = 0;
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment