diff options
author | shishir gowda <shishirng@gluster.com> | 2011-07-13 09:21:55 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-07-24 11:45:14 -0700 |
commit | 65cc08d80d5db6a6854249cc04bece0a9554adfb (patch) | |
tree | aa9ed8c9c3a3d3dcefee92c2951d678e3a3ffb65 | |
parent | b06ba047f48e92323d8dc8af7ed485d35fbbccf2 (diff) |
glusterd: Add bind-insecure xlator-option for glusterd
This is required if the number of connections from the glusterd
increases.
Change-Id: Iff78773f593a8bfae13ec9eec52c5a67ea936ef2
BUG: 3142
Signed-off-by: shishir gowda <shishirng@gluster.com>
Reviewed-on: http://review.gluster.com/11
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Pavan T C <tcp@gluster.com>
-rw-r--r-- | rpc/rpc-lib/src/rpc-transport.c | 19 | ||||
-rw-r--r-- | rpc/rpc-lib/src/rpc-transport.h | 2 | ||||
-rw-r--r-- | rpc/rpc-transport/socket/src/name.c | 2 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.c | 3 |
4 files changed, 18 insertions, 8 deletions
diff --git a/rpc/rpc-lib/src/rpc-transport.c b/rpc/rpc-lib/src/rpc-transport.c index e26e1d95f..082ceec6e 100644 --- a/rpc/rpc-lib/src/rpc-transport.c +++ b/rpc/rpc-lib/src/rpc-transport.c @@ -580,7 +580,7 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name) int32_t ret = -1; int8_t is_tcp = 0, is_unix = 0, is_ibsdp = 0; volume_opt_list_t *vol_opt = NULL; - gf_boolean_t client_bind_insecure = _gf_false; + gf_boolean_t bind_insecure = _gf_false; GF_VALIDATE_OR_GOTO("rpc-transport", options, fail); GF_VALIDATE_OR_GOTO("rpc-transport", ctx, fail); @@ -645,19 +645,26 @@ rpc_transport_load (glusterfs_ctx_t *ctx, dict_t *options, char *trans_name) } } + /* client-bind-insecure is for clients protocol, and + * bind-insecure for glusterd. Both mutually exclusive + */ ret = dict_get_str (options, "client-bind-insecure", &type); + if (ret) + ret = dict_get_str (options, "bind-insecure", &type); if (ret == 0) { - ret = gf_string2boolean (type, &client_bind_insecure); + ret = gf_string2boolean (type, &bind_insecure); if (ret < 0) { gf_log ("rcp-transport", GF_LOG_WARNING, - "client-bind-insecure option %s is not a" + "bind-insecure option %s is not a" " valid bool option", type); goto fail; } - if (_gf_true == client_bind_insecure) - trans->client_bind_insecure = 1; + if (_gf_true == bind_insecure) + trans->bind_insecure = 1; + else + trans->bind_insecure = 0; } else { - trans->client_bind_insecure = 0; + trans->bind_insecure = 0; } ret = dict_get_str (options, "transport-type", &type); diff --git a/rpc/rpc-lib/src/rpc-transport.h b/rpc/rpc-lib/src/rpc-transport.h index 3161ec9b0..f8396f572 100644 --- a/rpc/rpc-lib/src/rpc-transport.h +++ b/rpc/rpc-lib/src/rpc-transport.h @@ -215,7 +215,7 @@ struct rpc_transport { uint64_t total_bytes_write; struct list_head list; - int client_bind_insecure; + int bind_insecure; }; struct rpc_transport_ops { diff --git a/rpc/rpc-transport/socket/src/name.c b/rpc/rpc-transport/socket/src/name.c index a9813998e..ca0184576 100644 --- a/rpc/rpc-transport/socket/src/name.c +++ b/rpc/rpc-transport/socket/src/name.c @@ -438,7 +438,7 @@ client_bind (rpc_transport_t *this, *sockaddr_len = sizeof (struct sockaddr_in); case AF_INET6: - if (!this->client_bind_insecure) { + if (!this->bind_insecure) { ret = af_inet_bind_to_port_lt_ceiling (sock, sockaddr, *sockaddr_len, CLIENT_PORT_CEILING); } diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index 850332fd8..19a7d9da0 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -840,5 +840,8 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_BOOL, }, + { .key = {"bind-insecure"}, + .type = GF_OPTION_TYPE_BOOL, + }, { .key = {NULL} }, }; |