Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3c7c7e4812e40e50a9ce9d687432ab5515cb3f2f
Commit:     3c7c7e4812e40e50a9ce9d687432ab5515cb3f2f
Parent:     4c5680177012a2b5c0f3fdf58f4375dd84a1da67
Author:     Chuck Lever <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 10 14:59:35 2007 -0500
Committer:  Trond Myklebust <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 02:05:57 2008 -0500

    NFS: Pull covers off IPv6 address parsing
    
    Now that the needed IPv6 infrastructure is in place, allow the NFS client's
    IP address parser to generate AF_INET6 addresses.
    
    Signed-off-by: Chuck Lever <[EMAIL PROTECTED]>
    Signed-off-by: Trond Myklebust <[EMAIL PROTECTED]>
---
 fs/nfs/super.c |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 7efc6a3..3cbe32f 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -652,12 +652,23 @@ static void nfs_parse_server_address(char *value,
                                     struct sockaddr *sap,
                                     size_t *len)
 {
-       struct sockaddr_in *ap = (void *)sap;
+       if (strchr(value, ':')) {
+               struct sockaddr_in6 *ap = (struct sockaddr_in6 *)sap;
+               u8 *addr = (u8 *)&ap->sin6_addr.in6_u;
 
-       ap->sin_family = AF_INET;
-       *len = sizeof(*ap);
-       if (in4_pton(value, -1, (u8 *)&ap->sin_addr.s_addr, '\0', NULL))
-               return;
+               ap->sin6_family = AF_INET6;
+               *len = sizeof(*ap);
+               if (in6_pton(value, -1, addr, '\0', NULL))
+                       return;
+       } else {
+               struct sockaddr_in *ap = (struct sockaddr_in *)sap;
+               u8 *addr = (u8 *)&ap->sin_addr.s_addr;
+
+               ap->sin_family = AF_INET;
+               *len = sizeof(*ap);
+               if (in4_pton(value, -1, addr, '\0', NULL))
+                       return;
+       }
 
        sap->sa_family = AF_UNSPEC;
        *len = 0;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to