summaryrefslogtreecommitdiffstats
path: root/fs/nfs/super.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2008-08-20 22:10:23 +0200
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-10-08 00:17:47 +0200
commitea31a4437c59219bf3ea946d58984b01a45a289c (patch)
treed386f91c39461c7505e614f0b281f0e7e9b99298 /fs/nfs/super.c
parentnfs: prepare to share nfs_set_port (diff)
downloadlinux-ea31a4437c59219bf3ea946d58984b01a45a289c.tar.xz
linux-ea31a4437c59219bf3ea946d58984b01a45a289c.zip
nfs: Fix misparsing of nfsv4 fs_locations attribute
The code incorrectly assumes here that the server name (or ip address) is null-terminated. This can cause referrals to fail in some cases. Also support ipv6 addresses. Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r--fs/nfs/super.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index b99096b8e827..20dc4ccdff56 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -716,8 +716,6 @@ static void nfs_parse_ipv4_address(char *string, size_t str_len,
*addr_len = 0;
}
-#define IPV6_SCOPE_DELIMITER '%'
-
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
static void nfs_parse_ipv6_scope_id(const char *string, const size_t str_len,
const char *delim,
@@ -790,7 +788,7 @@ static void nfs_parse_ipv6_address(char *string, size_t str_len,
* If there is a problem constructing the new sockaddr, set the address
* family to AF_UNSPEC.
*/
-static void nfs_parse_ip_address(char *string, size_t str_len,
+void nfs_parse_ip_address(char *string, size_t str_len,
struct sockaddr *sap, size_t *addr_len)
{
unsigned int i, colons;