aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4namespace.c
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2007-12-10 14:59:06 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:56 -0500
commit6677d09513e35ac2f38d3a8c8a26fbd7bbcef192 (patch)
treec94931a3cb51c62638fe455afbac19f2edb81efa /fs/nfs/nfs4namespace.c
parentdcecae0ff44dceea7adb6bef5c8eb660fe87a93c (diff)
NFS: Adjust nfs_clone_mount structure to store "struct sockaddr *"
Change the addr field in the nfs_clone_mount structure to store a "struct sockaddr *" to support non-IPv4 addresses in the NFS client. Note this is mostly a cosmetic change, and does not actually allow referrals using IPv6 addresses. The existing referral code assumes that the server returns a string that represents an IPv4 address. This code needs to support hostnames and IPv6 addresses as well as IPv4 addresses, thus it will need to be reorganized completely (to handle DNS resolution in user space). 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/nfs4namespace.c')
-rw-r--r--fs/nfs/nfs4namespace.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index bd1b1617905d..5f9ba41ed5bf 100644
--- a/fs/nfs/nfs4namespace.c
+++ b/fs/nfs/nfs4namespace.c
@@ -172,7 +172,10 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
172 172
173 s = 0; 173 s = 0;
174 while (s < location->nservers) { 174 while (s < location->nservers) {
175 struct sockaddr_in addr = {}; 175 struct sockaddr_in addr = {
176 .sin_family = AF_INET,
177 .sin_port = htons(NFS_PORT),
178 };
176 179
177 if (location->servers[s].len <= 0 || 180 if (location->servers[s].len <= 0 ||
178 valid_ipaddr4(location->servers[s].data) < 0) { 181 valid_ipaddr4(location->servers[s].data) < 0) {
@@ -181,10 +184,9 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
181 } 184 }
182 185
183 mountdata.hostname = location->servers[s].data; 186 mountdata.hostname = location->servers[s].data;
184 addr.sin_addr.s_addr = in_aton(mountdata.hostname); 187 addr.sin_addr.s_addr = in_aton(mountdata.hostname),
185 addr.sin_family = AF_INET; 188 mountdata.addr = (struct sockaddr *)&addr;
186 addr.sin_port = htons(NFS_PORT); 189 mountdata.addrlen = sizeof(addr);
187 mountdata.addr = &addr;
188 190
189 snprintf(page, PAGE_SIZE, "%s:%s", 191 snprintf(page, PAGE_SIZE, "%s:%s",
190 mountdata.hostname, 192 mountdata.hostname,