From 80fcc8cef3cef509e7ca11f4f77930c8f76f78fe Mon Sep 17 00:00:00 2001 From: bixiaoyan Date: Tue, 7 Nov 2023 15:13:52 +0800 Subject: [PATCH] Fix loopback handling --- fix-loopback-handling.patch | 38 +++++++++++++++++++++++++++++++++++++ resource-agents.spec | 6 +++++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 fix-loopback-handling.patch diff --git a/fix-loopback-handling.patch b/fix-loopback-handling.patch new file mode 100644 index 0000000..490d971 --- /dev/null +++ b/fix-loopback-handling.patch @@ -0,0 +1,38 @@ +From 995641ec973ac2791eceeddc84c21cfc20cb28d5 Mon Sep 17 00:00:00 2001 +From: bixiaoyan +Date: Tue, 7 Nov 2023 15:08:31 +0800 +Subject: [PATCH] fix loopback handling + +--- + heartbeat/findif.sh | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/heartbeat/findif.sh b/heartbeat/findif.sh +index 5f1c19e..7c766e6 100644 +--- a/heartbeat/findif.sh ++++ b/heartbeat/findif.sh +@@ -29,10 +29,10 @@ prefixcheck() { + fi + return 0 + } +-getnetworkinfo() ++getloopbackinfo() + { + local line netinfo +- ip -o -f inet route list match $OCF_RESKEY_ip scope host | (while read line; ++ ip -o -f inet route list match $OCF_RESKEY_ip table local scope host | (while read line; + do + netinfo=`echo $line | awk '{print $2}'` + case $netinfo in +@@ -222,7 +222,7 @@ findif() + if [ $# = 0 ] ; then + case $OCF_RESKEY_ip in + 127.*) +- set -- `getnetworkinfo` ++ set -- `getloopbackinfo` + shift;; + esac + fi +-- +2.33.0 + diff --git a/resource-agents.spec b/resource-agents.spec index f2ba31a..71a2c87 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -1,12 +1,13 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.13.0 -Release: 2 +Release: 3 License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: https://github.com/ClusterLabs/resource-agents/archive/v%{version}.tar.gz Patch0000: fix-failed-to-parse-pid-from-pid-file.patch Patch0001: Fix-PRIMARY_IFACE-variable.patch +Patch0002: fix-loopback-handling.patch Obsoletes: heartbeat-resources <= %{version} Provides: heartbeat-resources = %{version} BuildRequires: automake autoconf pkgconfig gcc perl-interpreter perl-generators python3-devel @@ -104,6 +105,9 @@ export CFLAGS="$(echo '%{optflags}')" %{_mandir}/man8/{ocf-tester.8*,ldirectord.8*} %changelog +* Tue Nov 7 2023 bixiaoyan - 4.13.0-3 +- Fix loopback handling + * Fri Oct 27 2023 zouzhimin - 4.13.0-2 - Fix PRIMARY_IFACE variable -- Gitee