!17 Fix loopback handling

From: @bixiaoyan1 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
This commit is contained in:
openeuler-ci-bot 2023-11-07 07:30:55 +00:00 committed by Gitee
commit ee520c0a01
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 43 additions and 1 deletions

View File

@ -0,0 +1,38 @@
From 995641ec973ac2791eceeddc84c21cfc20cb28d5 Mon Sep 17 00:00:00 2001
From: bixiaoyan <bixiaoyan@kylinos.cn>
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

View File

@ -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 <bixiaoyan@kylinos.cn> - 4.13.0-3
- Fix loopback handling
* Fri Oct 27 2023 zouzhimin <zouzhimin@kylinos.cn> - 4.13.0-2
- Fix PRIMARY_IFACE variable