summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2016-04-28 11:42:28 +0530
committerAtin Mukherjee <amukherj@redhat.com>2016-04-28 22:29:11 -0700
commit72f048ae1ab893e81abff377a46570b5a12b7561 (patch)
tree392588da1a6d6732af1b82e65507c9a139d8a91d /xlators
parent2f945b86d30eca3a32f5e8e42fbe692ddf4b55be (diff)
glusterd: fix max pmap alloc to GF_PORT_MAX
This patch also mops the port max i.e 65535 hard coding Change-Id: Ia93656d75ceb4c6c4849f9e0ad1b260d5952d4c6 BUG: 1331253 Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com> Reviewed-on: http://review.gluster.org/14096 Tested-by: Prasanna Kumar Kalever <pkalever@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-pmap.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-pmap.c b/xlators/mgmt/glusterd/src/glusterd-pmap.c
index 46f0330d9e2..cbc800595ab 100644
--- a/xlators/mgmt/glusterd/src/glusterd-pmap.c
+++ b/xlators/mgmt/glusterd/src/glusterd-pmap.c
@@ -62,7 +62,7 @@ pmap_registry_new (xlator_t *this)
pmap->base_port = pmap->last_alloc =
((glusterd_conf_t *)(this->private))->base_port;
- for (i = pmap->base_port; i < 65536; i++) {
+ for (i = pmap->base_port; i <= GF_PORT_MAX; i++) {
if (pmap_port_isfree (i))
pmap->ports[i].type = GF_PMAP_PORT_FREE;
else
@@ -162,7 +162,7 @@ pmap_registry_search_by_port (xlator_t *this, int port)
struct pmap_registry *pmap = NULL;
char *brickname = NULL;
- if (port > 65535)
+ if (port > GF_PORT_MAX)
goto out;
pmap = pmap_registry_get (this);
@@ -184,7 +184,7 @@ pmap_registry_alloc (xlator_t *this)
pmap = pmap_registry_get (this);
- for (p = pmap->last_alloc; p < 65535; p++) {
+ for (p = pmap->last_alloc; p <= GF_PORT_MAX; p++) {
/* GF_PMAP_PORT_FOREIGN may be freed up ? */
if ((pmap->ports[p].type == GF_PMAP_PORT_FREE) ||
(pmap->ports[p].type == GF_PMAP_PORT_FOREIGN)) {
@@ -212,7 +212,7 @@ pmap_registry_bind (xlator_t *this, int port, const char *brickname,
pmap = pmap_registry_get (this);
- if (port > 65535)
+ if (port > GF_PORT_MAX)
goto out;
p = port;
@@ -246,7 +246,7 @@ pmap_registry_remove (xlator_t *this, int port, const char *brickname,
goto out;
if (port) {
- if (port > 65535)
+ if (port > GF_PORT_MAX)
goto out;
p = port;