summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-06-11 20:14:51 +0200
committerYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2008-06-12 02:19:09 +0200
commit28d4488216645cd71402925cffde9528b0cfdb7e (patch)
treec382b026e6c480827f0c539e3d2dcf3943389347 /net
parentipv6: Check the hop limit setting in ancillary data. (diff)
downloadlinux-28d4488216645cd71402925cffde9528b0cfdb7e.tar.xz
linux-28d4488216645cd71402925cffde9528b0cfdb7e.zip
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: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ipv6_sockglue.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index ce794d6acb70..9a3697172d5e 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;