From: YOSHIFUJI Hideaki Date: Wed, 11 Jun 2008 18:14:51 +0000 (+0900) Subject: ipv6: Check IPV6_MULTICAST_LOOP option value. X-Git-Tag: v2.6.26-rc7~40^2~5^2~1 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=28d4488216645cd71402925cffde9528b0cfdb7e;p=linux-2.6-omap-h63xx.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 ce794d6acb7..9a3697172d5 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;