From: Andre Naujoks <nautsch2@gmail.com>
To: "Maciej Żenczykowski" <maze@google.com>
Cc: Linux NetDev <netdev@vger.kernel.org>,
Kernel hackers <linux-kernel@vger.kernel.org>,
"David S. Miller" <davem@davemloft.net>,
kuznet@ms2.inr.ac.ru, Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Erik Kline <ek@google.com>, Thomas Gleixner <tglx@linutronix.de>,
Shaohua Li <shli@fb.com>,
Kate Stewart <kstewart@linuxfoundation.org>,
Philippe Ombredanne <pombredanne@nexb.com>
Subject: Re: [PATCH 1/1] ipv6: Add sockopt IPV6_MULTICAST_ALL analogue to IP_MULTICAST_ALL
Date: Mon, 10 Sep 2018 11:30:21 +0200 [thread overview]
Message-ID: <5532db3d-5387-8347-e017-6443d0096d08@gmail.com> (raw)
In-Reply-To: <CANP3RGfGkH33mYDrenwWVkQ4uG4qyrddA+yvJ+t+=y6wGd7uDA@mail.gmail.com>
On 9/10/18 11:07 AM, Maciej Żenczykowski wrote:
> Any reason not to use the same bit that is used by ipv4?
> (as in add the setsockopt/getsockopt but just toggle the v4 bit)
>
I wanted to keep the current behavior for an ipv6 socket as is. I think
user space api/behavioral changes are frowned upon!?
Currently the bit is settable for an ipv6 socket and changes the
handling for ipv4 multicasts for that socket. If I had just added the
socket option and set the v4 bit, you would get maybe unexpected
behavior from that, if you used it for ipv4 multicasts.
Another approach I tried, was to just honor the v4 bit in v6 context,
like this:
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 4ae54aaca373..af1659327d46 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -636,7 +636,7 @@ bool inet6_mc_check(struct sock *sk, const struct
in6_addr *mc_addr,
}
if (!mc) {
rcu_read_unlock();
- return true;
+ return inet_sk(sk)->mc_all;
}
read_lock(&mc->sflock);
psl = mc->sflist;
But that has the same problem of changing current behavior in a possibly
unexpected way.
Regards
Andre
next prev parent reply other threads:[~2018-09-10 9:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-10 8:27 [PATCH 0/1] add IPV6_MULTICAST_ALL sockopt Andre Naujoks
2018-09-10 8:27 ` [PATCH 1/1] ipv6: Add sockopt IPV6_MULTICAST_ALL analogue to IP_MULTICAST_ALL Andre Naujoks
2018-09-10 9:07 ` Maciej Żenczykowski
2018-09-10 9:30 ` Andre Naujoks [this message]
2018-09-13 15:17 ` David Miller
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=5532db3d-5387-8347-e017-6443d0096d08@gmail.com \
--to=nautsch2@gmail.com \
--cc=davem@davemloft.net \
--cc=ek@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kstewart@linuxfoundation.org \
--cc=kuznet@ms2.inr.ac.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=maze@google.com \
--cc=netdev@vger.kernel.org \
--cc=pombredanne@nexb.com \
--cc=shli@fb.com \
--cc=tglx@linutronix.de \
--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
Powered by JetHome