diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2007-12-10 14:57:09 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-01-30 02:05:51 -0500 |
commit | d4d3c507493afd3c9d19fbe9762f44e790909dbe (patch) | |
tree | 1ebbc2d84e3c058258701acf3e96aa5f6c309451 /fs/nfs/nfs4proc.c | |
parent | 4392f2592297876967191238a341667a6d4fc456 (diff) |
NFS: Enable NFS client to generate CLIENTID strings with IPv6 addresses
We recently added methods to RPC transports that provide string versions of
the remote peer address information. Convert the NFSv4 SETCLIENTID
procedure to use those methods instead of building the client ID out of
whole cloth.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r-- | fs/nfs/nfs4proc.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 26192a703129..5e8c4cf7959e 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -2891,14 +2891,18 @@ int nfs4_proc_setclientid(struct nfs_client *clp, u32 program, unsigned short po | |||
2891 | 2891 | ||
2892 | for(;;) { | 2892 | for(;;) { |
2893 | setclientid.sc_name_len = scnprintf(setclientid.sc_name, | 2893 | setclientid.sc_name_len = scnprintf(setclientid.sc_name, |
2894 | sizeof(setclientid.sc_name), "%s/%u.%u.%u.%u %s %u", | 2894 | sizeof(setclientid.sc_name), "%s/%s %s %u", |
2895 | clp->cl_ipaddr, NIPQUAD(clp->cl_addr.sin_addr), | 2895 | clp->cl_ipaddr, |
2896 | rpc_peeraddr2str(clp->cl_rpcclient, | ||
2897 | RPC_DISPLAY_ADDR), | ||
2896 | cred->cr_ops->cr_name, | 2898 | cred->cr_ops->cr_name, |
2897 | clp->cl_id_uniquifier); | 2899 | clp->cl_id_uniquifier); |
2898 | setclientid.sc_netid_len = scnprintf(setclientid.sc_netid, | 2900 | setclientid.sc_netid_len = scnprintf(setclientid.sc_netid, |
2899 | sizeof(setclientid.sc_netid), "tcp"); | 2901 | sizeof(setclientid.sc_netid), |
2902 | rpc_peeraddr2str(clp->cl_rpcclient, | ||
2903 | RPC_DISPLAY_NETID)); | ||
2900 | setclientid.sc_uaddr_len = scnprintf(setclientid.sc_uaddr, | 2904 | setclientid.sc_uaddr_len = scnprintf(setclientid.sc_uaddr, |
2901 | sizeof(setclientid.sc_uaddr), "%s.%d.%d", | 2905 | sizeof(setclientid.sc_uaddr), "%s.%u.%u", |
2902 | clp->cl_ipaddr, port >> 8, port & 255); | 2906 | clp->cl_ipaddr, port >> 8, port & 255); |
2903 | 2907 | ||
2904 | status = rpc_call_sync(clp->cl_rpcclient, &msg, 0); | 2908 | status = rpc_call_sync(clp->cl_rpcclient, &msg, 0); |