]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mountd: Handle IPv6 addresses in kernel auth_unix_ip upcalls
authorChuck Lever <chuck.lever@oracle.com>
Thu, 16 Sep 2010 18:21:08 +0000 (14:21 -0400)
committerSteve Dickson <steved@redhat.com>
Thu, 16 Sep 2010 18:33:51 +0000 (14:33 -0400)
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
utils/mountd/cache.c

index ab873d56ba4bb37eb36360613e5f5f132a7be26a..0e8a2f41c924abef17163a2cdc584fc3d963997e 100644 (file)
@@ -80,7 +80,7 @@ static void auth_unix_ip(FILE *f)
         */
        char *cp;
        char class[20];
-       char ipaddr[20];
+       char ipaddr[INET6_ADDRSTRLEN];
        char *client = NULL;
        struct addrinfo *tmp = NULL;
        struct addrinfo *ai = NULL;
@@ -95,7 +95,7 @@ static void auth_unix_ip(FILE *f)
            strcmp(class, "nfsd") != 0)
                return;
 
-       if (qword_get(&cp, ipaddr, 20) <= 0)
+       if (qword_get(&cp, ipaddr, sizeof(ipaddr)) <= 0)
                return;
 
        tmp = host_pton(ipaddr);
@@ -953,7 +953,7 @@ int cache_export(nfs_export *exp, char *path)
 
 
        qword_print(f, "nfsd");
-       qword_print(f, 
+       qword_print(f,
                host_ntop(get_addrlist(exp->m_client, 0), buf, sizeof(buf)));
        qword_printint(f, time(0)+30*60);
        qword_print(f, exp->m_client->m_hostname);