diff --git a/lib/nfs_v4.c b/lib/nfs_v4.c index 4ca0b4a..5675493 100644 --- a/lib/nfs_v4.c +++ b/lib/nfs_v4.c @@ -1585,6 +1585,7 @@ nfs4_mount_async(struct nfs_context *nfs, const char *server, { struct nfs4_cb_data *data; char *new_server, *new_export; + int port; new_server = strdup(server); free(nfs->server); @@ -1614,27 +1615,15 @@ nfs4_mount_async(struct nfs_context *nfs, const char *server, data->private_data = private_data; data->path = strdup(new_export); - if (nfs->nfsport) { - if (rpc_connect_port_async(nfs->rpc, server, nfs->nfsport, - NFS4_PROGRAM, NFS_V4, - nfs4_mount_1_cb, data) != 0) { - nfs_set_error(nfs, "Failed to start connection. %s", - nfs_get_error(nfs)); - free_nfs4_cb_data(data); - return -1; - } - return 0; - } - - if (rpc_connect_program_async(nfs->rpc, server, - NFS4_PROGRAM, NFS_V4, - nfs4_mount_1_cb, data) != 0) { + port = nfs->nfsport ? nfs->nfsport : 2049; + if (rpc_connect_port_async(nfs->rpc, server, port, + NFS4_PROGRAM, NFS_V4, + nfs4_mount_1_cb, data) != 0) { nfs_set_error(nfs, "Failed to start connection. %s", nfs_get_error(nfs)); free_nfs4_cb_data(data); return -1; } - return 0; } diff --git a/tests/test_8000_timeout.sh b/tests/test_8000_timeout.sh index f9774b0..d40bfbd 100755 --- a/tests/test_8000_timeout.sh +++ b/tests/test_8000_timeout.sh @@ -7,7 +7,7 @@ echo "NFSv${VERS} Basic timeout test." if [ $VERS -eq 3 ]; then COUNT=28 else - COUNT=18 + COUNT=13 fi start_share