summaryrefslogtreecommitdiffstats
path: root/xlators/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/nfs')
-rw-r--r--xlators/nfs/server/src/nfs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c
index 40fb24eef87..80bb9cebec3 100644
--- a/xlators/nfs/server/src/nfs.c
+++ b/xlators/nfs/server/src/nfs.c
@@ -580,7 +580,11 @@ nfs_init_state (xlator_t *this)
}
if (dict_get(this->options, "transport.socket.listen-port") == NULL) {
- ret = gf_asprintf (&optstr, "%d", nfs->override_portnum);
+ if (nfs->override_portnum)
+ ret = gf_asprintf (&optstr, "%d",
+ nfs->override_portnum);
+ else
+ ret = gf_asprintf (&optstr, "%d", GF_NFS3_PORT);
if (ret == -1) {
gf_log (GF_NFS, GF_LOG_ERROR, "failed mem-allocation");
goto free_foppool;