Blame SOURCES/bz2054249-fix-unweighted-track-scripts.patch

9648ed
From d93b2051641ebfc4c5dcdc405ed0f26b9bcaa65a Mon Sep 17 00:00:00 2001
9648ed
From: Quentin Armitage <quentin@armitage.org.uk>
9648ed
Date: Sat, 25 Jul 2020 10:13:32 +0100
9648ed
Subject: [PATCH] vrrp: Don't remove unweighted track scripts from sync group
9648ed
 members
9648ed
9648ed
Commit 3390697 - "vrrp: rewrote framework using list_head_t design"
9648ed
cleared the track_script list for any vrrp instance that was in a
9648ed
sync group. This was due to the old list structure allocating memory
9648ed
which had to be freed if the list was empty, but that is no longer
9648ed
the case with list_head.
9648ed
9648ed
Signed-off-by: Quentin Armitage <quentin@armitage.org.uk>
9648ed
---
9648ed
 keepalived/vrrp/vrrp.c | 3 +--
9648ed
 1 file changed, 1 insertion(+), 2 deletions(-)
9648ed
9648ed
diff --git a/keepalived/vrrp/vrrp.c b/keepalived/vrrp/vrrp.c
9648ed
index c8967eef..c7ded6b4 100644
9648ed
--- a/keepalived/vrrp/vrrp.c
9648ed
+++ b/keepalived/vrrp/vrrp.c
9648ed
@@ -3406,7 +3406,7 @@ vrrp_complete_instance(vrrp_t * vrrp)
9648ed
 		free_track_if_list(&vrrp->track_ifp);
9648ed
 
9648ed
 		/* Ignore any weighted script */
9648ed
-		list_for_each_entry_safe(sc, sc_tmp, &vrrp->track_script,e_list) {
9648ed
+		list_for_each_entry_safe(sc, sc_tmp, &vrrp->track_script, e_list) {
9648ed
 			if (sc->weight) {
9648ed
 				report_config_error(CONFIG_GENERAL_ERROR, "(%s) ignoring "
9648ed
 									  "tracked script %s with weights due to %s"
9648ed
@@ -3417,7 +3417,6 @@ vrrp_complete_instance(vrrp_t * vrrp)
9648ed
 				free_track_script(sc);
9648ed
 			}
9648ed
 		}
9648ed
-		free_track_script_list(&vrrp->track_script);
9648ed
 
9648ed
 		/* Set tracking files to unweighted if weight not explicitly set, otherwise ignore */
9648ed
 		list_for_each_entry_safe(tfl, tfl_tmp, &vrrp->track_file, e_list) {
9648ed
-- 
9648ed
2.33.1
9648ed