From: YOSHIFUJI Hideaki Date: Wed, 11 Jun 2008 18:14:51 +0000 (+0900) Subject: ipv6: Check IPV6_MULTICAST_LOOP option value. X-Git-Tag: v3.12-rc1~20339^2~5^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28d4488216645cd71402925cffde9528b0cfdb7e;p=kernel%2Fkernel-generic.git 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 . Signed-off-by: YOSHIFUJI Hideaki --- diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index ce794d6..9a36971 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c @@ -458,6 +458,8 @@ done: case IPV6_MULTICAST_LOOP: if (optlen < sizeof(int)) goto e_inval; + if (val != valbool) + goto e_inval; np->mc_loop = valbool; retv = 0; break;