libexport.a: Reduce code duplication in client_init() From: Chuck Lever Clean up: Most cases in client_init() set clp->m_naddr to zero. Move it to the common part of the function, and simplify the logic. This will make adding IPv6 support here more straightforward. Signed-off-by: Chuck Lever Signed-off-by: Steve Dickson --- support/export/client.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- nfs-utils-1.2.1.orig/support/export/client.c +++ nfs-utils-1.2.1/support/export/client.c @@ -137,6 +137,7 @@ client_init(nfs_client *clp, const char clp->m_exported = 0; clp->m_count = 0; + clp->m_naddr = 0; if (clp->m_type == MCL_SUBNETWORK) { char *cp = strchr(clp->m_hostname, '/'); @@ -160,10 +161,10 @@ client_init(nfs_client *clp, const char } } *cp = '/'; - clp->m_naddr = 0; - } else if (!hp) { - clp->m_naddr = 0; - } else { + return; + } + + if (hp) { char **ap = hp->h_addr_list; int i;