diff options
author | J. Bruce Fields <bfields@citi.umich.edu> | 2008-08-20 16:10:23 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-10-07 18:17:47 -0400 |
commit | ea31a4437c59219bf3ea946d58984b01a45a289c (patch) | |
tree | d386f91c39461c7505e614f0b281f0e7e9b99298 /fs/nfs/super.c | |
parent | f0c929251e01a7a86b6254c775cb6b65c6457f10 (diff) |
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.c | 4 |
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, | |||
716 | *addr_len = 0; | 716 | *addr_len = 0; |
717 | } | 717 | } |
718 | 718 | ||
719 | #define IPV6_SCOPE_DELIMITER '%' | ||
720 | |||
721 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 719 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
722 | static void nfs_parse_ipv6_scope_id(const char *string, const size_t str_len, | 720 | static void nfs_parse_ipv6_scope_id(const char *string, const size_t str_len, |
723 | const char *delim, | 721 | const char *delim, |
@@ -790,7 +788,7 @@ static void nfs_parse_ipv6_address(char *string, size_t str_len, | |||
790 | * If there is a problem constructing the new sockaddr, set the address | 788 | * If there is a problem constructing the new sockaddr, set the address |
791 | * family to AF_UNSPEC. | 789 | * family to AF_UNSPEC. |
792 | */ | 790 | */ |
793 | static void nfs_parse_ip_address(char *string, size_t str_len, | 791 | void nfs_parse_ip_address(char *string, size_t str_len, |
794 | struct sockaddr *sap, size_t *addr_len) | 792 | struct sockaddr *sap, size_t *addr_len) |
795 | { | 793 | { |
796 | unsigned int i, colons; | 794 | unsigned int i, colons; |