netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: liuhangbin@gmail.com
Cc: netdev@vger.kernel.org, challa@noironetworks.com,
	dsahern@gmail.com, jishi@redhat.com
Subject: Re: [PATCHv2 net] ipv6/addrconf: allow adding multicast addr if IFA_F_MCAUTOJOIN is set
Date: Wed, 21 Aug 2019 20:40:19 -0700 (PDT)	[thread overview]
Message-ID: <20190821.204019.904624122090676066.davem@davemloft.net> (raw)
In-Reply-To: <20190820021947.22718-1-liuhangbin@gmail.com>

From: Hangbin Liu <liuhangbin@gmail.com>
Date: Tue, 20 Aug 2019 10:19:47 +0800

> In commit 93a714d6b53d ("multicast: Extend ip address command to enable
> multicast group join/leave on") we added a new flag IFA_F_MCAUTOJOIN
> to make user able to add multicast address on ethernet interface.
> 
> This works for IPv4, but not for IPv6. See the inet6_addr_add code.
> 
> static int inet6_addr_add()
> {
> 	...
> 	if (cfg->ifa_flags & IFA_F_MCAUTOJOIN) {
> 		ipv6_mc_config(net->ipv6.mc_autojoin_sk, true...)
> 	}
> 
> 	ifp = ipv6_add_addr(idev, cfg, true, extack); <- always fail with maddr
> 	if (!IS_ERR(ifp)) {
> 		...
> 	} else if (cfg->ifa_flags & IFA_F_MCAUTOJOIN) {
> 		ipv6_mc_config(net->ipv6.mc_autojoin_sk, false...)
> 	}
> }
> 
> But in ipv6_add_addr() it will check the address type and reject multicast
> address directly. So this feature is never worked for IPv6.
> 
> We should not remove the multicast address check totally in ipv6_add_addr(),
> but could accept multicast address only when IFA_F_MCAUTOJOIN flag supplied.
> 
> v2: update commit description
> 
> Reported-by: Jianlin Shi <jishi@redhat.com>
> Fixes: 93a714d6b53d ("multicast: Extend ip address command to enable multicast group join/leave on")
> Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>

Applied and queued up for -stable.

      parent reply	other threads:[~2019-08-22  3:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-13 13:52 [PATCH net] ipv6/addrconf: allow adding multicast addr if IFA_F_MCAUTOJOIN is set Hangbin Liu
2019-08-20  0:32 ` David Miller
2019-08-20  2:19 ` [PATCHv2 " Hangbin Liu
2019-08-20  2:33   ` David Ahern
2019-08-22  8:20     ` Hangbin Liu
2019-08-23 12:41       ` David Ahern
2019-08-22  3:40   ` David Miller [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=20190821.204019.904624122090676066.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=challa@noironetworks.com \
    --cc=dsahern@gmail.com \
    --cc=jishi@redhat.com \
    --cc=liuhangbin@gmail.com \
    --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).