LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] [PATCH] [LDIRECTORD] Fix logic bug in _status_down

To: Sebastian Vieira <sebvieira@xxxxxxxxx>
Subject: Re: [lvs-users] [PATCH] [LDIRECTORD] Fix logic bug in _status_down
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Horms <horms@xxxxxxxxxxxx>
Date: Thu, 5 Jul 2007 13:37:35 +0900
Fix a logig bug in _status_down() that prevented fallback servers
from being removed if

a) at start no other real servers were present and
b) a real server was subsequently added

The new logic is the logical not of that found in _status_up

With thanks to Sebastian Vieira

Signed-off-by: Simon Horman <horms@xxxxxxxxxxxx>

Index: heartbeat/ldirectord/ldirectord.in
===================================================================
--- heartbeat.orig/ldirectord/ldirectord.in     2007-07-05 12:56:45.000000000 
+0900
+++ heartbeat/ldirectord/ldirectord.in  2007-07-05 12:56:45.000000000 +0900
@@ -3080,9 +3080,9 @@ sub _status_down
        my $real_id = get_real_id_str($r, $v);
 
        if (defined($is_fallback)) {
-               if (! defined($v->{real_status}) or
-                               ! defined($v->{fallback_status}) or
-                               ! $v->{fallback_status}->{"$real_id"}) {
+               if (! defined($v->{real_status}) and
+                                (! defined($v->{fallback_status}) or
+                                 !$v->{fallback_status}->{"$real_id"})) {
                        return undef;
                }
        }


<Prev in Thread] Current Thread [Next in Thread>