All of lore.kernel.org
 help / color / mirror / Atom feed
* Forming an NFSv4 clientid
@ 2006-11-02 17:53 Chuck Lever
  2006-11-02 19:05 ` Trond Myklebust
  0 siblings, 1 reply; 5+ messages in thread
From: Chuck Lever @ 2006-11-02 17:53 UTC (permalink / raw)
  To: Trond Myklebust, J. Bruce Fields; +Cc: NFS List

While considering what will need to change to support IPv6, I noticed
this logic, which forms the NFSv4 clientid:

   2927                 setclientid.sc_name_len = scnprintf(setclientid.sc_name,
   2928                                 sizeof(setclientid.sc_name),
"%s/%u.%u.%u.%u %s %u",
   2929                                 clp->cl_ipaddr,
NIPQUAD(clp->cl_addr.sin_addr),
   2930                                 cred->cr_ops->cr_name,
   2931                                 clp->cl_id_uniquifier);

When would the contents of cl_ipaddr not be the same as the result of
the NIPQUAD?  For IPv6, the NIPQUAD will have to be replaced, or
removed.  Any suggestions?

-- 
"We who cut mere stones must always be envisioning cathedrals"
   -- Quarry worker's creed

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Forming an NFSv4 clientid
  2006-11-02 17:53 Forming an NFSv4 clientid Chuck Lever
@ 2006-11-02 19:05 ` Trond Myklebust
  2006-11-02 19:24   ` Chuck Lever
  0 siblings, 1 reply; 5+ messages in thread
From: Trond Myklebust @ 2006-11-02 19:05 UTC (permalink / raw)
  To: Chuck Lever; +Cc: J. Bruce Fields, NFS List

On Thu, 2006-11-02 at 12:53 -0500, Chuck Lever wrote:
> While considering what will need to change to support IPv6, I noticed
> this logic, which forms the NFSv4 clientid:
> 
>    2927                 setclientid.sc_name_len = scnprintf(setclientid.sc_name,
>    2928                                 sizeof(setclientid.sc_name),
> "%s/%u.%u.%u.%u %s %u",
>    2929                                 clp->cl_ipaddr,
> NIPQUAD(clp->cl_addr.sin_addr),
>    2930                                 cred->cr_ops->cr_name,
>    2931                                 clp->cl_id_uniquifier);
> 
> When would the contents of cl_ipaddr not be the same as the result of
> the NIPQUAD?  For IPv6, the NIPQUAD will have to be replaced, or
> removed.  Any suggestions?

They are _not_ the same. cl_ipaddr is the client ip address, whereas
clp->cl_addr is the server ip address.

Just replace clp->cl_addr with your usual "print server address"
routine, increase the size of cl_ipaddr so that it can take an IPv6
string, and adjust the size of setclientid.sc_name accordingly.

Cheers,
  Trond


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Forming an NFSv4 clientid
  2006-11-02 19:05 ` Trond Myklebust
@ 2006-11-02 19:24   ` Chuck Lever
  2006-11-03 18:44     ` J. Bruce Fields
  0 siblings, 1 reply; 5+ messages in thread
From: Chuck Lever @ 2006-11-02 19:24 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: J. Bruce Fields, NFS List

On 11/2/06, Trond Myklebust <trond.myklebust@fys.uio.no> wrote:
> On Thu, 2006-11-02 at 12:53 -0500, Chuck Lever wrote:
> > While considering what will need to change to support IPv6, I noticed
> > this logic, which forms the NFSv4 clientid:
> >
> >    2927                 setclientid.sc_name_len = scnprintf(setclientid.sc_name,
> >    2928                                 sizeof(setclientid.sc_name),
> > "%s/%u.%u.%u.%u %s %u",
> >    2929                                 clp->cl_ipaddr,
> > NIPQUAD(clp->cl_addr.sin_addr),
> >    2930                                 cred->cr_ops->cr_name,
> >    2931                                 clp->cl_id_uniquifier);
> >
> > When would the contents of cl_ipaddr not be the same as the result of
> > the NIPQUAD?  For IPv6, the NIPQUAD will have to be replaced, or
> > removed.  Any suggestions?
>
> They are _not_ the same. cl_ipaddr is the client ip address, whereas
> clp->cl_addr is the server ip address.

The names of these fields are a little confusing.  The structure is
"nfs_client" and the field is "cl_addr", yet this is the address of
the remote peer.  I'd like cl_srvaddr or cl_remote_addr better.

Not much distinction for the "cl_ipaddr" field either.  Maybe
cl_formattedlocaladdr, although ugly, would be more descriptive.  Or
following the precedent set in the RPC client: cl_local_addrbuf?

> Just replace clp->cl_addr with your usual "print server address"
> routine, increase the size of cl_ipaddr so that it can take an IPv6
> string, and adjust the size of setclientid.sc_name accordingly.

Yep, sounds good.

-- 
"We who cut mere stones must always be envisioning cathedrals"
   -- Quarry worker's creed

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Forming an NFSv4 clientid
  2006-11-02 19:24   ` Chuck Lever
@ 2006-11-03 18:44     ` J. Bruce Fields
  2006-11-03 18:47       ` Trond Myklebust
  0 siblings, 1 reply; 5+ messages in thread
From: J. Bruce Fields @ 2006-11-03 18:44 UTC (permalink / raw)
  To: Chuck Lever; +Cc: NFS List, Trond Myklebust

On Thu, Nov 02, 2006 at 02:24:21PM -0500, Chuck Lever wrote:
> On 11/2/06, Trond Myklebust <trond.myklebust@fys.uio.no> wrote:
> >On Thu, 2006-11-02 at 12:53 -0500, Chuck Lever wrote:
> >> While considering what will need to change to support IPv6, I noticed
> >> this logic, which forms the NFSv4 clientid:
> >>
> >>    2927                 setclientid.sc_name_len = 
> >scnprintf(setclientid.sc_name,
> >>    2928                                 sizeof(setclientid.sc_name),
> >> "%s/%u.%u.%u.%u %s %u",
> >>    2929                                 clp->cl_ipaddr,
> >> NIPQUAD(clp->cl_addr.sin_addr),
> >>    2930                                 cred->cr_ops->cr_name,
> >>    2931                                 clp->cl_id_uniquifier);
> >>
> >> When would the contents of cl_ipaddr not be the same as the result of
> >> the NIPQUAD?  For IPv6, the NIPQUAD will have to be replaced, or
> >> removed.  Any suggestions?
> >
> >They are _not_ the same. cl_ipaddr is the client ip address, whereas
> >clp->cl_addr is the server ip address.
> 
> The names of these fields are a little confusing.

Completely agreed.  I stumble over that regularly.

--b.

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Forming an NFSv4 clientid
  2006-11-03 18:44     ` J. Bruce Fields
@ 2006-11-03 18:47       ` Trond Myklebust
  0 siblings, 0 replies; 5+ messages in thread
From: Trond Myklebust @ 2006-11-03 18:47 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: NFS List, Chuck Lever

On Fri, 2006-11-03 at 13:44 -0500, J. Bruce Fields wrote:
> On Thu, Nov 02, 2006 at 02:24:21PM -0500, Chuck Lever wrote:
> > On 11/2/06, Trond Myklebust <trond.myklebust@fys.uio.no> wrote:
> > >On Thu, 2006-11-02 at 12:53 -0500, Chuck Lever wrote:
> > >> While considering what will need to change to support IPv6, I noticed
> > >> this logic, which forms the NFSv4 clientid:
> > >>
> > >>    2927                 setclientid.sc_name_len = 
> > >scnprintf(setclientid.sc_name,
> > >>    2928                                 sizeof(setclientid.sc_name),
> > >> "%s/%u.%u.%u.%u %s %u",
> > >>    2929                                 clp->cl_ipaddr,
> > >> NIPQUAD(clp->cl_addr.sin_addr),
> > >>    2930                                 cred->cr_ops->cr_name,
> > >>    2931                                 clp->cl_id_uniquifier);
> > >>
> > >> When would the contents of cl_ipaddr not be the same as the result of
> > >> the NIPQUAD?  For IPv6, the NIPQUAD will have to be replaced, or
> > >> removed.  Any suggestions?
> > >
> > >They are _not_ the same. cl_ipaddr is the client ip address, whereas
> > >clp->cl_addr is the server ip address.
> > 
> > The names of these fields are a little confusing.
> 
> Completely agreed.  I stumble over that regularly.

I'm always willing to accept patches :-)

Trond


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-11-03 18:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-02 17:53 Forming an NFSv4 clientid Chuck Lever
2006-11-02 19:05 ` Trond Myklebust
2006-11-02 19:24   ` Chuck Lever
2006-11-03 18:44     ` J. Bruce Fields
2006-11-03 18:47       ` Trond Myklebust

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.