summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrishna <ksriniva@redhat.com>2012-03-09 09:43:18 +0530
committerVijay Bellur <vijay@gluster.com>2012-03-10 01:09:27 -0800
commit3193c56b7e3d0be9713138784b1a6477136add9e (patch)
tree1dee32e745cd47a7b4a84bfdfcc61206e99cbda6
parent17111383828b44bf8f437aef76870c2c01fdd946 (diff)
nlm: support ipv4 only
Change-Id: I0d8381b7d4da0e961677cca63d6d2c82836c1632 BUG: 800735 Signed-off-by: krishna <ksriniva@redhat.com> Reviewed-on: http://review.gluster.com/2909 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/nfs/server/src/nlm4.c22
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");