* [RFC][PATCH 2/3] IPv6:Check IPV6_MULTICAST_LOOP option value
@ 2008-06-10 7:51 Shan Wei
2008-06-10 8:13 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 1 reply; 2+ messages in thread
From: Shan Wei @ 2008-06-10 7:51 UTC (permalink / raw)
To: YOSHIFUJI Hideaki / 吉藤英明, netdev; +Cc: davem
RFC3493 says, IPV6_MULTICAST_LOOP option can only be set with o or 1.
when other valuse are set, the kernel should return an error of EINVAL.
In addition, the option should not be uesd by SOCK_STREAM type, same as
IPV6_MULTICAST_IF, IPV6_MULTICAST_HOPS.
But the kernel doesn't check them.
Signed-off-by: Shan Wei<shanwei@cn.fujitsu.com>
---
net/ipv6/ipv6_sockglue.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c
index 26b83e5..3b45def 100644
--- a/net/ipv6/ipv6_sockglue.c
+++ b/net/ipv6/ipv6_sockglue.c
@@ -456,8 +456,12 @@ done:
break;
case IPV6_MULTICAST_LOOP:
+ if (sk->sk_type == SOCK_STREAM)
+ goto e_inval;
if (optlen < sizeof(int))
goto e_inval;
+ if (val > 1 || val < 0)
+ goto e_inval;
np->mc_loop = valbool;
retv = 0;
break;
--
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [RFC][PATCH 2/3] IPv6:Check IPV6_MULTICAST_LOOP option value
2008-06-10 7:51 [RFC][PATCH 2/3] IPv6:Check IPV6_MULTICAST_LOOP option value Shan Wei
@ 2008-06-10 8:13 ` YOSHIFUJI Hideaki / 吉藤英明
0 siblings, 0 replies; 2+ messages in thread
From: YOSHIFUJI Hideaki / 吉藤英明 @ 2008-06-10 8:13 UTC (permalink / raw)
To: shanwei; +Cc: netdev, davem, yoshfuji
In article <484E3277.5030808@cn.fujitsu.com> (at Tue, 10 Jun 2008 15:51:19 +0800), Shan Wei <shanwei@cn.fujitsu.com> says:
> RFC3493 says, IPV6_MULTICAST_LOOP option can only be set with o or 1.
> when other valuse are set, the kernel should return an error of EINVAL.
>
> In addition, the option should not be uesd by SOCK_STREAM type, same as
> IPV6_MULTICAST_IF, IPV6_MULTICAST_HOPS.
>
> But the kernel doesn't check them.
I'm goint to queue this with litle change.
Thanks.
--yoshfuji
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-06-10 8:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-10 7:51 [RFC][PATCH 2/3] IPv6:Check IPV6_MULTICAST_LOOP option value Shan Wei
2008-06-10 8:13 ` YOSHIFUJI Hideaki / 吉藤英明
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).