]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
libexport.a: fix using bad index for loop at cltsetup()
authorMi Jinlong <mijinlong@cn.fujitsu.com>
Wed, 22 Jun 2011 19:41:27 +0000 (15:41 -0400)
committerSteve Dickson <steved@redhat.com>
Wed, 22 Jun 2011 22:31:57 +0000 (18:31 -0400)
In cltsetup(), when checking the address, use clp's naddr for index,
instead of  cltarg's naddr, which it's always zero there.

Signed-off-by: Mi Jinlong <mijinlong@cn.fujitsu.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/export/nfsctl.c

index f89c644a81c119e93d00ab5b8c60e0b49228c5e9..2950a90e8a6f2f55998e104e1f54e9d0c84489dc 100644 (file)
@@ -78,7 +78,7 @@ cltsetup(struct nfsctl_client *cltarg, nfs_client *clp)
        str_tolower(cltarg->cl_ident);
 
        j = 0;
-       for (i = 0; i < cltarg->cl_naddr && i < NFSCLNT_ADDRMAX; i++) {
+       for (i = 0; i < clp->m_naddr && i < NFSCLNT_ADDRMAX; i++) {
                const struct sockaddr_in *sin = get_addrlist_in(clp, i);
                if (sin->sin_family == AF_INET)
                        cltarg->cl_addrlist[j++] = sin->sin_addr;