Blame SOURCES/bz1078197-fix_broken_restrictions_on_the_port_ranges.patch

bdb0eb
From 630f390d94254c0b689e9ba386479f2e56f37784 Mon Sep 17 00:00:00 2001
bdb0eb
From: Ryan McCabe <rmccabe@redhat.com>
bdb0eb
Date: Tue, 3 Mar 2015 13:38:25 -0500
bdb0eb
Subject: [PATCH] fence-virt: Fix broken restrictions on the port ranges
bdb0eb
bdb0eb
Fix broken port range check.
bdb0eb
bdb0eb
Resolves: rhbz#1078197
bdb0eb
bdb0eb
Signed-off-by: Ryan McCabe <rmccabe@redhat.com>
bdb0eb
---
bdb0eb
 client/options.c | 2 +-
bdb0eb
 server/config.c  | 2 +-
bdb0eb
 2 files changed, 2 insertions(+), 2 deletions(-)
bdb0eb
bdb0eb
diff --git a/client/options.c b/client/options.c
bdb0eb
index 653fae4..a44c15f 100644
bdb0eb
--- a/client/options.c
bdb0eb
+++ b/client/options.c
bdb0eb
@@ -134,7 +134,7 @@ assign_port(fence_virt_args_t *args, struct arg_info *arg, char *value)
bdb0eb
 		return;
bdb0eb
 
bdb0eb
 	args->net.port = atoi(value);
bdb0eb
-	if (args->net.port <= 0 || args->net.port >= 65500) {
bdb0eb
+	if (args->net.port <= 0 || args->net.port >= 65536) {
bdb0eb
 		printf("Invalid port: '%s'\n", value);
bdb0eb
 		args->flags |= F_ERR;
bdb0eb
 	}
bdb0eb
diff --git a/server/config.c b/server/config.c
bdb0eb
index 87d826e..6ba8b6d 100644
bdb0eb
--- a/server/config.c
bdb0eb
+++ b/server/config.c
bdb0eb
@@ -239,7 +239,7 @@ listener_config_multicast(config_object_t *config)
bdb0eb
 		text_input("Multicast IP Port", val, inp, sizeof(inp));
bdb0eb
 
bdb0eb
 		done = atoi(inp);
bdb0eb
-		if (done <= 0 || done > 65534) {
bdb0eb
+		if (done <= 0 || done >= 65536) {
bdb0eb
 			printf("Port value '%s' is out of range\n", val);
bdb0eb
 			continue;
bdb0eb
 		}
bdb0eb
-- 
bdb0eb
2.5.5
bdb0eb