All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Spencer Baugh <sbaugh-n2IX9UM++eDQT0dZR+AlfA@public.gmane.org>
Cc: Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Spencer Baugh
	<spencer.baugh-BHEL68pLQRGGvPXPguhicg@public.gmane.org>,
	Joern Engel <joern-BHEL68pLQRGGvPXPguhicg@public.gmane.org>,
	"open list:INFINIBAND SUBSYSTEM"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Hal Rosenstock
	<hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	open list <linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH] RDMA/cma: fix IPv6 address resolution
Date: Fri, 14 Aug 2015 22:05:46 -0400	[thread overview]
Message-ID: <55CE9E7A.8080303@redhat.com> (raw)
In-Reply-To: <CAL1RGDVO0N98f=ip6R7X1QK=Xuxa156HkRUOvfnNCVdD4thoCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2432 bytes --]

On 08/13/2015 03:21 PM, Roland Dreier wrote:
> Reviewed-by: Roland Dreier <roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org
> <mailto:roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>>
> 
> On Aug 13, 2015 12:19 PM, "Spencer Baugh" <sbaugh-n2IX9UM++eDQT0dZR+AlfA@public.gmane.org
> <mailto:sbaugh-n2IX9UM++eDQT0dZR+AlfA@public.gmane.org>> wrote:
>>
>> Resolving a link-local IPv6 address with an unspecified source address
>> was broken by commit 5462eddd7a, which prevented the IPv6 stack from
>> learning the scope id of the link-local IPv6 address, causing random
>> failures as the IP stack chose a random link to resolve the address on.
>>
>> This commit 5462eddd7a made us bail out of cma_check_linklocal early if
>> the address passed in was not an IPv6 link-local address. On the address
>> resolution path, the address passed in is the source address; if the
>> source address is the unspecified address, which is not link-local, we
>> will bail out early.
>>
>> This is mostly correct, but if the destination address is a link-local
>> address, then we will be following a link-local route, and we'll need to
>> tell the IPv6 stack what the scope id of the destination address is.
>> This used to be done by last line of cma_check_linklocal, which is
>> skipped when bailing out early:
>>
>>         dev_addr->bound_dev_if = sin6->sin6_scope_id;
>>
>> (In cma_bind_addr, the sin6_scope_id of the source address is set to the
>> sin6_scope_id of the destination address, so this is correct)
>> This line is required in turn for the following line, L279 of
>> addr6_resolve, to actually inform the IPv6 stack of the scope id:
>>
>>       fl6.flowi6_oif = addr->bound_dev_if;
>>
>> Since we can only know we are in this failure case when we have access
>> to both the source IPv6 address and destination IPv6 address, we have to
>> deal with this further up the stack. So detect this failure case in
>> cma_bind_addr, and set bound_dev_if to the destination address scope id
>> to correct it.
>>
>> Signed-off-by: Spencer Baugh <sbaugh-n2IX9UM++eDQT0dZR+AlfA@public.gmane.org
> <mailto:sbaugh-n2IX9UM++eDQT0dZR+AlfA@public.gmane.org>>
>> ---
>>  drivers/infiniband/core/cma.c | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)

I've picked this up, thanks.


-- 
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Doug Ledford <dledford@redhat.com>
To: Roland Dreier <roland@kernel.org>, Spencer Baugh <sbaugh@catern.com>
Cc: Sean Hefty <sean.hefty@intel.com>,
	Spencer Baugh <spencer.baugh@purestorage.com>,
	Joern Engel <joern@purestorage.com>,
	"open list:INFINIBAND SUBSYSTEM" <linux-rdma@vger.kernel.org>,
	Hal Rosenstock <hal.rosenstock@gmail.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] RDMA/cma: fix IPv6 address resolution
Date: Fri, 14 Aug 2015 22:05:46 -0400	[thread overview]
Message-ID: <55CE9E7A.8080303@redhat.com> (raw)
In-Reply-To: <CAL1RGDVO0N98f=ip6R7X1QK=Xuxa156HkRUOvfnNCVdD4thoCQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2239 bytes --]

On 08/13/2015 03:21 PM, Roland Dreier wrote:
> Reviewed-by: Roland Dreier <roland@purestorage.com
> <mailto:roland@purestorage.com>>
> 
> On Aug 13, 2015 12:19 PM, "Spencer Baugh" <sbaugh@catern.com
> <mailto:sbaugh@catern.com>> wrote:
>>
>> Resolving a link-local IPv6 address with an unspecified source address
>> was broken by commit 5462eddd7a, which prevented the IPv6 stack from
>> learning the scope id of the link-local IPv6 address, causing random
>> failures as the IP stack chose a random link to resolve the address on.
>>
>> This commit 5462eddd7a made us bail out of cma_check_linklocal early if
>> the address passed in was not an IPv6 link-local address. On the address
>> resolution path, the address passed in is the source address; if the
>> source address is the unspecified address, which is not link-local, we
>> will bail out early.
>>
>> This is mostly correct, but if the destination address is a link-local
>> address, then we will be following a link-local route, and we'll need to
>> tell the IPv6 stack what the scope id of the destination address is.
>> This used to be done by last line of cma_check_linklocal, which is
>> skipped when bailing out early:
>>
>>         dev_addr->bound_dev_if = sin6->sin6_scope_id;
>>
>> (In cma_bind_addr, the sin6_scope_id of the source address is set to the
>> sin6_scope_id of the destination address, so this is correct)
>> This line is required in turn for the following line, L279 of
>> addr6_resolve, to actually inform the IPv6 stack of the scope id:
>>
>>       fl6.flowi6_oif = addr->bound_dev_if;
>>
>> Since we can only know we are in this failure case when we have access
>> to both the source IPv6 address and destination IPv6 address, we have to
>> deal with this further up the stack. So detect this failure case in
>> cma_bind_addr, and set bound_dev_if to the destination address scope id
>> to correct it.
>>
>> Signed-off-by: Spencer Baugh <sbaugh@catern.com
> <mailto:sbaugh@catern.com>>
>> ---
>>  drivers/infiniband/core/cma.c | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)

I've picked this up, thanks.


-- 
Doug Ledford <dledford@redhat.com>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

  parent reply	other threads:[~2015-08-15  2:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-13 19:19 [PATCH] RDMA/cma: fix IPv6 address resolution Spencer Baugh
2015-08-13 19:19 ` Spencer Baugh
     [not found] ` <CAL1RGDVO0N98f=ip6R7X1QK=Xuxa156HkRUOvfnNCVdD4thoCQ@mail.gmail.com>
     [not found]   ` <CAL1RGDVO0N98f=ip6R7X1QK=Xuxa156HkRUOvfnNCVdD4thoCQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-08-15  2:05     ` Doug Ledford [this message]
2015-08-15  2:05       ` Doug Ledford
     [not found] ` <1439493550-5958-1-git-send-email-sbaugh-n2IX9UM++eDQT0dZR+AlfA@public.gmane.org>
2015-09-03 20:03   ` Doug Ledford
2015-09-03 20:03     ` Doug Ledford

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=55CE9E7A.8080303@redhat.com \
    --to=dledford-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=joern-BHEL68pLQRGGvPXPguhicg@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sbaugh-n2IX9UM++eDQT0dZR+AlfA@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=spencer.baugh-BHEL68pLQRGGvPXPguhicg@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.