netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Yasevich <vladislav.yasevich@hp.com>
To: David Stevens <dlstevens@us.ibm.com>
Cc: Brian Haley <brian.haley@hp.com>,
	David Miller <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	netdev-owner@vger.kernel.org,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Subject: Re: [PATCH] [IPv6]: IPV6_MULTICAST_IF setting is ignored on link-local connect()
Date: Wed, 19 Dec 2007 14:02:02 -0500	[thread overview]
Message-ID: <47696AAA.2010107@hp.com> (raw)
In-Reply-To: <OF367F9F64.87ED9167-ON882573B6.0063B893-882573B6.0064BE22@us.ibm.com>

David Stevens wrote:
> Vlad Yasevich <vladislav.yasevich@hp.com> wrote on 12/19/2007 07:20:53 AM:
> 
>> But this still requires either a SO_BINDTODEVICE or sin6_scope_id.  This
>> means the an application can call BINDTODEVICE(eth0), MULTICAST_IF(eth1)
>> issue a connect on a UDP socket an succeed?  Seems wrong to me.
>>
>> Can you check section 6.7 of RFC 3542.
> 
>         No, it requires one of SO_BINDTODEVICE, sin6_scope_id, or 
> IPV6_MULTICAST_IF.
> If you do an SO_BINDTODEVICE(eth0) and then an IPV6_MULTICAST_IF(eth1), 
> the
> IPV6_MULTICAST_IF will fail in setsockopt (EINVAL), because it requires a 
> match
> for bound sockets.

I should have checked that...  so the case I thought off is not possible...


> I'm not sure if SO_BINDTODEVICE resets mcast_oif if you 
> do
> them in the reverse order, but that would be a bug in SO_BINDTODEVICE.

I don't think that would be needed since SO_BINDTODEVICE always wins over
IPV6_MULTICAST_IF, so even if they mismatch, SO_BINDTODEVICE is still used.

>         The precedence order as implemented already is:
> 
>                 SO_BINDTODEVICE is highest and always wins
>                 sin6_scope_id next
>                 IPV6_MULTICAST_IF
> 
> and the existing code has the rule that all link-local addresses require a
> sin6_scope_id. The change (intended) is to relax the sin6_scope_id rule 
> only
> for link-local multicasts that have done either an SO_BINDTODEVICE or
> IPV6_MULTICAST_IF already.
> 

Ok, but I don't think your patch accomplishes that, as Brian pointed out.

-vlad

  reply	other threads:[~2007-12-19 19:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-18 20:57 [PATCH] [IPv6]: IPV6_MULTICAST_IF setting is ignored on link-local connect() Brian Haley
2007-12-18 21:52 ` David Stevens
2007-12-18 22:34   ` Brian Haley
2007-12-18 23:56     ` David Stevens
2007-12-19 15:20       ` Vlad Yasevich
2007-12-19 18:18         ` David Stevens
2007-12-19 19:02           ` Vlad Yasevich [this message]
2007-12-19 19:14           ` Brian Haley
2007-12-19 15:35       ` Brian Haley
2007-12-19 18:57         ` David Stevens
2007-12-19 19:15           ` Brian Haley
2007-12-19 19:28             ` David Stevens
2008-01-07 17:03           ` Brian Haley
2008-01-08  1:18             ` David Stevens
2008-01-09  7:53               ` 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=47696AAA.2010107@hp.com \
    --to=vladislav.yasevich@hp.com \
    --cc=brian.haley@hp.com \
    --cc=davem@davemloft.net \
    --cc=dlstevens@us.ibm.com \
    --cc=netdev-owner@vger.kernel.org \
    --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).