diff options
Diffstat (limited to 'xlators/nfs/server')
-rw-r--r-- | xlators/nfs/server/src/nlm4.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c index bc55cfff1be..170c994d56c 100644 --- a/xlators/nfs/server/src/nlm4.c +++ b/xlators/nfs/server/src/nlm4.c @@ -840,10 +840,16 @@ nlm4_establish_callback (void *csarg) sockaddr = (struct sockaddr*) &sa; switch (sockaddr->sa_family) { case AF_INET6: + /* can not come here as NLM listens on IPv4 */ + gf_log (GF_NLM, GF_LOG_ERROR, "NLM is not supported on IPv6 in" + " this release"); + goto err; +/* inet_ntop (AF_INET6, &((struct sockaddr_in6 *)sockaddr)->sin6_addr, peerip, INET6_ADDRSTRLEN+1); break; +*/ case AF_INET: inet_ntop (AF_INET, &((struct sockaddr_in *)sockaddr)->sin_addr, @@ -858,6 +864,12 @@ nlm4_establish_callback (void *csarg) port = pmap_getport ((struct sockaddr_in*)sockaddr, NLM_PROGRAM, NLM_V4, IPPROTO_TCP); + if (port == 0) { + gf_log (GF_NLM, GF_LOG_ERROR, "Unable to get NLM port of the " + "client. Is the firewall running on client?"); + goto err; + } + options = dict_new(); ret = dict_set_str (options, "transport-type", "socket"); if (ret == -1) { @@ -915,7 +927,9 @@ nlm4_establish_callback (void *csarg) } nlm4svc_send_granted (cs); err: - rpc_clnt_unref (rpc_clnt); + if (rpc_clnt) { + rpc_clnt_unref (rpc_clnt); + } return NULL; } @@ -1741,6 +1755,12 @@ nlm4svc_init(xlator_t *nfsx) } } + ret = dict_set_str (options, "transport.address-family", "inet"); + if (ret == -1) { + gf_log (GF_NLM, GF_LOG_ERROR, "dict_set_str error"); + goto err; + } + rpcsvc_create_listeners (nfs->rpcsvc, options, "NLM"); if (ret == -1) { gf_log (GF_NLM, GF_LOG_ERROR, "Unable to create listeners"); |