diff options
author | Atin Mukherjee <amukherj@redhat.com> | 2017-08-10 18:31:55 +0530 |
---|---|---|
committer | Atin Mukherjee <amukherj@redhat.com> | 2017-08-17 04:02:20 +0000 |
commit | 3998c28324c8907b9b3ade75c98a6a0e4591f23b (patch) | |
tree | 0f8dd704dabdac15c03fcc383f44171c167ae807 /xlators/mgmt/glusterd/src/glusterd.c | |
parent | 204d52a4b6c13d16132f67ee94f823fa23c11538 (diff) |
glusterd: introduce max-port range
glusterd.vol file always had an option (commented out) to indicate the
base-port to start the portmapper allocation. This patch brings in the
max-port configuration where one can limit the range of ports which
gluster can be allowed to bind.
Fixes: #305
Change-Id: Id7a864f818227b9530a07e13d605138edacd9aa9
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://review.gluster.org/18016
Smoke: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Prashanth Pai <ppai@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Gaurav Yadav <gyadav@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c index 4887ff413bf..556423f2f7f 100644 --- a/xlators/mgmt/glusterd/src/glusterd.c +++ b/xlators/mgmt/glusterd/src/glusterd.c @@ -1823,12 +1823,20 @@ init (xlator_t *this) if (ret) goto out; - conf->base_port = GF_IANA_PRIV_PORTS_START; - if (dict_get_uint32(this->options, "base-port", &conf->base_port) == 0) { + conf->base_port = GF_IANA_PRIV_PORTS_START; + if (dict_get_uint32 (this->options, "base-port", + &conf->base_port) == 0) { gf_msg (this->name, GF_LOG_INFO, 0, GD_MSG_DICT_SET_FAILED, "base-port override: %d", conf->base_port); } + conf->max_port = GF_PORT_MAX; + if (dict_get_uint32 (this->options, "max-port", + &conf->max_port) == 0) { + gf_msg (this->name, GF_LOG_INFO, 0, + GD_MSG_DICT_SET_FAILED, + "max-port override: %d", conf->max_port); + } /* Set option to run bricks on valgrind if enabled in glusterd.vol */ this->ctx->cmd_args.valgrind = valgrind; @@ -2134,6 +2142,11 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_INT, .description = "Sets the base port for portmap query" }, + { .key = {"max-port"}, + .type = GF_OPTION_TYPE_INT, + .max = GF_PORT_MAX, + .description = "Sets the max port for portmap query" + }, { .key = {"snap-brick-path"}, .type = GF_OPTION_TYPE_STR, .description = "directory where the bricks for the snapshots will be created" |