All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: "J. Bruce Fields" <bfields@fieldses.org>,
	Mi Jinlong <mijinlong@cn.fujitsu.com>,
	NFS <linux-nfs@vger.kernel.org>,
	Trond Myklebust <Trond.Myklebust@netapp.com>
Subject: Re: [PATCH] sunrpc: Add scope id to svc_addr_u for IPv6 LINKLOCAL address
Date: Mon, 22 Aug 2011 15:44:39 -0400	[thread overview]
Message-ID: <73D17319-3FDB-4278-872A-FF488E1C88DD@oracle.com> (raw)
In-Reply-To: <20110822153939.14d0a6ac@tlielax.poochiereds.net>


On Aug 22, 2011, at 3:39 PM, Jeff Layton wrote:

> On Mon, 22 Aug 2011 15:23:48 -0400
> "J. Bruce Fields" <bfields@fieldses.org> wrote:
> 
>> On Sat, Aug 20, 2011 at 06:24:29PM +0800, Mi Jinlong wrote:
>>> For IPv6 local address, lockd can not callback to client for 
>>> missing scope id when binding address at inet6_bind:
>>> 
>>> 324       if (addr_type & IPV6_ADDR_LINKLOCAL) {
>>> 325               if (addr_len >= sizeof(struct sockaddr_in6) &&
>>> 326                   addr->sin6_scope_id) {
>>> 327                       /* Override any existing binding, if another one
>>> 328                        * is supplied by user.
>>> 329                        */
>>> 330                       sk->sk_bound_dev_if = addr->sin6_scope_id;
>>> 331               }
>>> 332 
>>> 333               /* Binding to link-local address requires an interface */
>>> 334               if (!sk->sk_bound_dev_if) {
>>> 335                       err = -EINVAL;
>>> 336                       goto out_unlock;
>>> 337               }
>>> 
>>> This patch adds scope id to svc_addr_u for IPv6 address, and copy scope from
>>> xprt->xpt_local to rqstp->rq_daddr for use.
>>> 
>>> With this patch, lockd can callback to client success.
>> 
>> I guess this makes sense to me, but someone who understands IPv6 better
>> should comment... Chuck?  Jeff?
>> 
> 
> Sounds like a reasonable explanation. Link-local addresses all have the
> same prefix, so we need a scopeid (aka interface ID# for linux) to know
> which interface we should send a call on.
> 
> When I did the patches to allow NFSv4 callbacks to go over IPv6, I
> did something similar, but used the rq_addr. From gen_callback:
> 
>        struct sockaddr *sa = svc_addr(rqstp);
>        u32 scopeid = rpc_get_scope_id(sa);
> 
> ...and the scopeid was used to populate the scopeid of the callback
> address. The rq_daddr should be equivalent though. The _addr and _daddr
> must have the same scopeid or something is very wrong...

Sure, that would preclude the need to upgrade the field to a struct sockaddr_storage.

> That said, on a semi-related note...
> 
> I have to wonder about statd in conjunction with link-local addresses.
> I have a hard time understanding how you'd ever get reboot
> notifications in such a setup.

The only way that could work is if DNS was able to look at a local hostname, and provide the correct scope ID.  Doubtful.  I wonder if mDNS might provide such ability.

> You might be able to make it work if /etc/hosts allowed you to put in a
> scopeid for an address, but even then it sounds sketchy...

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





  reply	other threads:[~2011-08-22 19:45 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-20 10:24 [PATCH] sunrpc: Add scope id to svc_addr_u for IPv6 LINKLOCAL address Mi Jinlong
2011-08-22 19:23 ` J. Bruce Fields
2011-08-22 19:39   ` Jeff Layton
2011-08-22 19:44     ` Chuck Lever [this message]
2011-08-22 21:08       ` J. Bruce Fields
2011-08-23 14:43       ` Jeff Layton
2011-08-24  8:00         ` Mi Jinlong
2011-08-24 15:15           ` Chuck Lever
2011-08-22 19:26 ` J. Bruce Fields
2011-08-22 19:32   ` Chuck Lever
2011-08-22 19:44     ` J. Bruce Fields
2011-08-23  9:40       ` Mi Jinlong
2011-08-24  5:58       ` Mi Jinlong
2011-08-24 18:39         ` J. Bruce Fields
2011-08-25  0:02           ` Mi Jinlong
2011-08-25  9:58         ` Jeff Layton
2011-08-25 14:30         ` Chuck Lever
2011-08-25 14:37           ` Chuck Lever
2011-08-26  6:58             ` Mi Jinlong
2011-08-26 22:43               ` J. Bruce Fields
2011-08-27 22:03                 ` Chuck Lever
2011-08-29 15:26               ` Jeff Layton
2011-08-29 15:30                 ` Chuck Lever
2011-08-29 17:09               ` Steve Dickson

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=73D17319-3FDB-4278-872A-FF488E1C88DD@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=bfields@fieldses.org \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=mijinlong@cn.fujitsu.com \
    /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.