Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 158604
b: refs/heads/master
c: 7d7ea88
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Aug 19, 2009
1 parent 183527f commit 3ca4981
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e571cbf1a4f8d8b6cfd4898df718dae84c75a8e1
refs/heads/master: 7d7ea882898f23989209d0359691b356f73240dc
18 changes: 17 additions & 1 deletion trunk/fs/nfs/nfs4namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/inet.h>
#include "internal.h"
#include "nfs4_fs.h"
#include "dns_resolve.h"

#define NFSDBG_FACILITY NFSDBG_VFS

Expand Down Expand Up @@ -95,6 +96,20 @@ static int nfs4_validate_fspath(const struct vfsmount *mnt_parent,
return 0;
}

static size_t nfs_parse_server_name(char *string, size_t len,
struct sockaddr *sa, size_t salen)
{
ssize_t ret;

ret = rpc_pton(string, len, sa, salen);
if (ret == 0) {
ret = nfs_dns_resolve_name(string, len, sa, salen);
if (ret < 0)
ret = 0;
}
return ret;
}

static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
char *page, char *page2,
const struct nfs4_fs_location *location)
Expand All @@ -121,7 +136,8 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,

if (memchr(buf->data, IPV6_SCOPE_DELIMITER, buf->len))
continue;
mountdata->addrlen = rpc_pton(buf->data, buf->len,
mountdata->addrlen = nfs_parse_server_name(buf->data,
buf->len,
mountdata->addr, mountdata->addrlen);
if (mountdata->addrlen == 0)
continue;
Expand Down

0 comments on commit 3ca4981

Please sign in to comment.