netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Haley <brian.haley@hp.com>
To: David Woodhouse <dwmw2@infradead.org>
Cc: netdev@vger.kernel.org, "Yuniverg,
	Michael" <michael.yuniverg@intel.com>,
	"Yedvab, Nadav" <nadav.yedvab@intel.com>,
	YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Subject: Re: SO_BINDTODEVICE inconsistency between IPv4 and IPv6
Date: Fri, 18 Mar 2011 10:31:46 -0400	[thread overview]
Message-ID: <4D836CD2.5070807@hp.com> (raw)
In-Reply-To: <1300438473.16342.18.camel@macbook.infradead.org>

On 03/18/2011 04:54 AM, David Woodhouse wrote:
> On Thu, 2011-03-17 at 21:26 -0400, Brian Haley wrote:
>> Hmm, "connection refused", do you have any iptables rules installed?  Connecting
>> to a local global address worked fine for me on 2.6.32-30 using a home-grown
>> test app.
> 
> Thanks for looking at this.
> 
> Just to confirm... after your server does SO_BINDTODEVICE to 'lo', your
> clients on the same host can make a successful connection to global IPv6
> addresses which are assigned to the *other* interfaces? 
> 
> Can you show your version of the test app, and your results? What kernel
> is this on?

Sorry, I just re-ran my test again and noticed the SO_BINDTODEVICE failed,
since I was running it as myself, not root, so I see the same behavior as
you.  I'm not sure if this is a bug per-se, and there is this comment
in ip6_rcv() pointing towards this:

        /*
         * Store incoming device index. When the packet will
         * be queued, we cannot refer to skb->dev anymore.
         *
         * BTW, when we send a packet for our own local address on a
         * non-loopback interface (e.g. ethX), it is being delivered
         * via the loopback interface (lo) here; skb->dev = loopback_dev.
         * It, however, should be considered as if it is being
         * arrived via the sending interface (ethX), because of the
         * nature of scoping architecture. --yoshfuji
         */
        IP6CB(skb)->iif = skb_dst(skb) ? ip6_dst_idev(skb_dst(skb))->dev->ifindex : dev->ifindex;

That's probably why it's not matching.

I think Yoshifuji would be the best one to ask, cc'd.

-Brian

  reply	other threads:[~2011-03-18 14:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-17 10:29 SO_BINDTODEVICE inconsistency between IPv4 and IPv6 David Woodhouse
2011-03-18  1:26 ` Brian Haley
2011-03-18  8:54   ` David Woodhouse
2011-03-18 14:31     ` Brian Haley [this message]
2011-05-27 23:07 ` David Woodhouse
2011-06-07 12:55   ` Yuniverg, Michael

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=4D836CD2.5070807@hp.com \
    --to=brian.haley@hp.com \
    --cc=dwmw2@infradead.org \
    --cc=michael.yuniverg@intel.com \
    --cc=nadav.yedvab@intel.com \
    --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).