From: Mi Jinlong Date: Wed, 22 Jun 2011 19:41:27 +0000 (-0400) Subject: libexport.a: fix using bad index for loop at cltsetup() X-Git-Tag: nfs-utils-1-2-4-rc9~4 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=c7ce7a4674ad446bee4dd3baf90155ce6b216816;p=nfs-utils.git libexport.a: fix using bad index for loop at cltsetup() 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 Signed-off-by: Steve Dickson --- diff --git a/support/export/nfsctl.c b/support/export/nfsctl.c index f89c644..2950a90 100644 --- a/support/export/nfsctl.c +++ b/support/export/nfsctl.c @@ -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;