Skip to content

Commit

Permalink
ipv6: Check IPV6_MULTICAST_LOOP option value.
Browse files Browse the repository at this point in the history
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 <[email protected]>.

Signed-off-by: YOSHIFUJI Hideaki <[email protected]>
  • Loading branch information
yoshfuji committed Jun 12, 2008
1 parent e8766fc commit 28d4488
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/ipv6/ipv6_sockglue.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,8 @@ static int do_ipv6_setsockopt(struct sock *sk, int level, int optname,
case IPV6_MULTICAST_LOOP:
if (optlen < sizeof(int))
goto e_inval;
if (val != valbool)
goto e_inval;
np->mc_loop = valbool;
retv = 0;
break;
Expand Down

0 comments on commit 28d4488

Please sign in to comment.