From: Dmitry Baryshkov <dbaryshkov@gmail.com>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Fallback to ipv4 if we try to add join IPv4 multicast group via ipv4-mapped address.
Date: Wed, 03 Oct 2007 17:26:35 +0400 [thread overview]
Message-ID: <4703988B.3010904@gmail.com> (raw)
In-Reply-To: <OFDC1D2E6E.2DCF75EA-ON88257368.0053513A-88257368.005586DC@us.ibm.com>
Hello,
David Stevens wrote:
> Dmitry,
> Good catch; a couple comments:
Thank you for the response.
>
>> struct ipv6_pinfo *np = inet6_sk(sk);
>> int err;
>> + int addr_type = ipv6_addr_type(addr);
>> +
>> + if (addr_type == IPV6_ADDR_MAPPED) {
>> + __be32 v4addr = addr->s6_addr32[3];
>> + struct ip_mreqn mreq;
>> + mreq.imr_multiaddr.s_addr = v4addr;
>> + mreq.imr_address.s_addr = INADDR_ANY;
>> + mreq.imr_ifindex = ifindex;
>> +
>> + return ip_mc_join_group(sk, &mreq);
>> + }
>
> ipv6_addr_type() returns a bitmask, so you should use:
>
> if (addr_type & IPV6_ADDR_MAPPED) {
I just c'n'pasted the code that checks for mapped addresses. In most
cases it's just ==, not bitmask operation.
>
> Also, you should have a blank line after the "mreq" declaration.
ok.
>
> Ditto for both in ipv6_mc_sock_drop().
> I don't expect the multicast source filtering interface will
> behave well for mapped addresses, either. The mapped multicast
> address won't appear to be a multicast address (and return
> error there), and all the source filters would have to be
> v4mapped addresses and modify the v4 source filters for this
> to do as you expect. So, there's more to it (and it may be a
> bit messy) to support mapped multicast addresses fully. I'll
> think about that part some more.
Didn't have time to test it throughly. I've only checked that call
succeeds and that all necessary igmp are sent. I hope, this weekend I'll
have more time to check.
--
With best wishes
Dmitry Baryshkov
prev parent reply other threads:[~2007-10-03 13:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-02 9:59 [PATCH] Fallback to ipv4 if we try to add join IPv4 multicast group via ipv4-mapped address Dmitry Baryshkov
2007-10-02 15:35 ` David Stevens
2007-10-03 13:26 ` Dmitry Baryshkov [this message]
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=4703988B.3010904@gmail.com \
--to=dbaryshkov@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.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).