File 0008-Low-ldirectord-Fix-unset-failcount-error.patch of Package resource-agents.2497

From cfe54818fd7071846eb45a587071caf9e0b9fef3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <krig@koru.se>
Date: Fri, 22 Jan 2016 14:34:45 +0100
Subject: [PATCH 8/9] Low: ldirectord: Fix unset failcount error

This error was noticed in the logs:

Use of uninitialized value in numeric gt (>)

The uninitialized use comes from the "_service_up" function
which tries to read an uninitialized array element "failcount"
which get only written (set > 0) in the "_service_down" function.

This patch sets failcount to 0 in the constructor to avoid
triggering the error.
---
 ldirectord/ldirectord.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ldirectord/ldirectord.in b/ldirectord/ldirectord.in
index 5fca81f..306ecfb 100644
--- a/ldirectord/ldirectord.in
+++ b/ldirectord/ldirectord.in
@@ -2103,7 +2103,7 @@ sub add_real_server
 	my $new_rsrv;
 	my $rsrv;
 
-	$new_rsrv = {"server"=>$ip, "port"=>$port};
+	$new_rsrv = {"server"=>$ip, "port"=>$port, "failcount"=>0};
 
 	$flags =~ /(\w+)(.*)/ && ($1 eq "gate" || $1 eq "masq" || $1 eq "ipip")
 		or &config_error($line,	"forward method must be gate, masq or ipip");
-- 
2.6.2

openSUSE Build Service is sponsored by