From: Shan Wei <shanwei@cn.fujitsu.com>
To: "YOSHIFUJI Hideaki / 吉藤英明" <yoshfuji@linux-ipv6.org>,
netdev@vger.kernel.org
Cc: davem@davemloft.net
Subject: [RFC][PATCH 2/3] IPv6:Check IPV6_MULTICAST_LOOP option value
Date: Tue, 10 Jun 2008 15:51:19 +0800 [thread overview]
Message-ID: <484E3277.5030808@cn.fujitsu.com> (raw)
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;
--
next reply other threads:[~2008-06-10 7:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-10 7:51 Shan Wei [this message]
2008-06-10 8:13 ` [RFC][PATCH 2/3] IPv6:Check IPV6_MULTICAST_LOOP option value YOSHIFUJI Hideaki / 吉藤英明
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=484E3277.5030808@cn.fujitsu.com \
--to=shanwei@cn.fujitsu.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=yoshfuji@linux-ipv6.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).