Blob Blame History Raw
From 8e42d6970457336bd92d327c628e38129f221f8a Mon Sep 17 00:00:00 2001
From: Quentin Armitage <quentin@armitage.org.uk>
Date: Mon, 17 Jul 2017 11:43:28 +0100
Subject: [PATCH] Correct comparison for checker compare in
 migrate_failed_checkers

Commit 2ff6b3f changed the sense of the comparisons of checkers,
but didn't make the corresponding change to checking the result.

Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
---
 keepalived/check/check_api.c | 4 ++--
 keepalived/check/ipwrapper.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/keepalived/check/check_api.c b/keepalived/check/check_api.c
index 1d915414..82b0f2df 100644
--- a/keepalived/check/check_api.c
+++ b/keepalived/check/check_api.c
@@ -266,8 +266,8 @@ register_checkers_thread(void)
 
 	for (e = LIST_HEAD(checkers_queue); e; ELEMENT_NEXT(e)) {
 		checker = ELEMENT_DATA(e);
-		log_message(LOG_INFO, "%sctivating healthchecker for service %s"
-				    , checker->enabled ? "A" : "Dea", FMT_VS(checker->vs));
+		log_message(LOG_INFO, "%sctivating healthchecker for service %s"
+				    , checker->enabled ? "A" : "Dea", FMT_VS(checker->vs));
 		if (checker->launch)
 		{
 			/* wait for a random timeout to begin checker thread.
diff --git a/keepalived/check/ipwrapper.c b/keepalived/check/ipwrapper.c
index 17f0157d..ad8c3154 100644
--- a/keepalived/check/ipwrapper.c
+++ b/keepalived/check/ipwrapper.c
@@ -649,7 +649,7 @@ migrate_failed_checkers(real_server_t *old_rs, real_server_t *new_rs)
 			continue;
 		for (e1 = LIST_HEAD(l); e1; ELEMENT_NEXT(e1)) {
 			old_c = ELEMENT_DATA(e1);
-			if (old_c->compare == new_c->compare && new_c->compare(old_c, new_c) == 0) {
+			if (old_c->compare == new_c->compare && new_c->compare(old_c, new_c)) {
 				if (svr_checker_up(old_c->id, old_rs) == 0) {
 					id = (checker_id_t *) MALLOC(sizeof(checker_id_t));
 					*id = new_c->id;
-- 
2.21.0