Blob Blame History Raw
From 630f390d94254c0b689e9ba386479f2e56f37784 Mon Sep 17 00:00:00 2001
From: Ryan McCabe <rmccabe@redhat.com>
Date: Tue, 3 Mar 2015 13:38:25 -0500
Subject: [PATCH] fence-virt: Fix broken restrictions on the port ranges

Fix broken port range check.

Resolves: rhbz#1078197

Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
---
 client/options.c | 2 +-
 server/config.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/client/options.c b/client/options.c
index 653fae4..a44c15f 100644
--- a/client/options.c
+++ b/client/options.c
@@ -134,7 +134,7 @@ assign_port(fence_virt_args_t *args, struct arg_info *arg, char *value)
 		return;
 
 	args->net.port = atoi(value);
-	if (args->net.port <= 0 || args->net.port >= 65500) {
+	if (args->net.port <= 0 || args->net.port >= 65536) {
 		printf("Invalid port: '%s'\n", value);
 		args->flags |= F_ERR;
 	}
diff --git a/server/config.c b/server/config.c
index 87d826e..6ba8b6d 100644
--- a/server/config.c
+++ b/server/config.c
@@ -239,7 +239,7 @@ listener_config_multicast(config_object_t *config)
 		text_input("Multicast IP Port", val, inp, sizeof(inp));
 
 		done = atoi(inp);
-		if (done <= 0 || done > 65534) {
+		if (done <= 0 || done >= 65536) {
 			printf("Port value '%s' is out of range\n", val);
 			continue;
 		}
-- 
2.5.5