- findif.sh: dont use table parameter as it returns no netmask

This commit is contained in:
eabdullin 2023-11-07 12:31:13 +03:00
parent aa742ca345
commit 98d9c7702f
2 changed files with 87 additions and 6 deletions

View File

@ -0,0 +1,79 @@
From cf2fd2a9cf06dc2e915f2fb5dbcc5e09e907a6df Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Thu, 5 Oct 2023 11:53:18 +0200
Subject: [PATCH] findif.sh: dont use table parameter as it returns no netmask
(tested with main/local/custom tables)
---
heartbeat/IPaddr2 | 12 ------------
heartbeat/findif.sh | 8 ++++----
2 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
index e8384c5866..97a7431a24 100755
--- a/heartbeat/IPaddr2
+++ b/heartbeat/IPaddr2
@@ -73,7 +73,6 @@ OCF_RESKEY_ip_default=""
OCF_RESKEY_cidr_netmask_default=""
OCF_RESKEY_broadcast_default=""
OCF_RESKEY_iflabel_default=""
-OCF_RESKEY_table_default=""
OCF_RESKEY_cidr_netmask_default=""
OCF_RESKEY_lvs_support_default=false
OCF_RESKEY_lvs_ipv6_addrlabel_default=false
@@ -98,7 +97,6 @@ OCF_RESKEY_network_namespace_default=""
: ${OCF_RESKEY_cidr_netmask=${OCF_RESKEY_cidr_netmask_default}}
: ${OCF_RESKEY_broadcast=${OCF_RESKEY_broadcast_default}}
: ${OCF_RESKEY_iflabel=${OCF_RESKEY_iflabel_default}}
-: ${OCF_RESKEY_table=${OCF_RESKEY_table_default}}
: ${OCF_RESKEY_lvs_support=${OCF_RESKEY_lvs_support_default}}
: ${OCF_RESKEY_lvs_ipv6_addrlabel=${OCF_RESKEY_lvs_ipv6_addrlabel_default}}
: ${OCF_RESKEY_lvs_ipv6_addrlabel_value=${OCF_RESKEY_lvs_ipv6_addrlabel_value_default}}
@@ -241,16 +239,6 @@ If a label is specified in nic name, this parameter has no effect.
<content type="string" default="${OCF_RESKEY_iflabel_default}"/>
</parameter>
-<parameter name="table">
-<longdesc lang="en">
-Table to use to lookup which interface to use for the IP.
-
-This can be used for policy based routing. See man ip-rule(8).
-</longdesc>
-<shortdesc lang="en">Table</shortdesc>
-<content type="string" default="${OCF_RESKEY_table_default}" />
-</parameter>
-
<parameter name="lvs_support">
<longdesc lang="en">
Enable support for LVS Direct Routing configurations. In case a IP
diff --git a/heartbeat/findif.sh b/heartbeat/findif.sh
index 6c04c98c19..5f1c19ec3c 100644
--- a/heartbeat/findif.sh
+++ b/heartbeat/findif.sh
@@ -32,7 +32,7 @@ prefixcheck() {
getnetworkinfo()
{
local line netinfo
- ip -o -f inet route list match $OCF_RESKEY_ip table "${OCF_RESKEY_table:=main}" scope host | (while read line;
+ ip -o -f inet route list match $OCF_RESKEY_ip scope host | (while read line;
do
netinfo=`echo $line | awk '{print $2}'`
case $netinfo in
@@ -210,14 +210,14 @@ findif()
fi
findif_check_params $family || return $?
- if [ -n "$netmask" ] ; then
+ if [ -n "$netmask" ]; then
match=$match/$netmask
fi
if [ -n "$nic" ] ; then
# NIC supports more than two.
- set -- $(ip -o -f $family route list match $match $scope table "${OCF_RESKEY_table:=main}" | grep "dev $nic " | awk 'BEGIN{best=0} /\// { mask=$1; sub(".*/", "", mask); if( int(mask)>=best ) { best=int(mask); best_ln=$0; } } END{print best_ln}')
+ set -- $(ip -o -f $family route list match $match $scope | grep "dev $nic " | awk 'BEGIN{best=0} /\// { mask=$1; sub(".*/", "", mask); if( int(mask)>=best ) { best=int(mask); best_ln=$0; } } END{print best_ln}')
else
- set -- $(ip -o -f $family route list match $match $scope table "${OCF_RESKEY_table:=main}" | awk 'BEGIN{best=0} /\// { mask=$1; sub(".*/", "", mask); if( int(mask)>=best ) { best=int(mask); best_ln=$0; } } END{print best_ln}')
+ set -- $(ip -o -f $family route list match $match $scope | awk 'BEGIN{best=0} /\// { mask=$1; sub(".*/", "", mask); if( int(mask)>=best ) { best=int(mask); best_ln=$0; } } END{print best_ln}')
fi
if [ $# = 0 ] ; then
case $OCF_RESKEY_ip in

View File

@ -45,7 +45,7 @@
Name: resource-agents
Summary: Open Source HA Reusable Cluster Resource Scripts
Version: 4.10.0
Release: 43%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}
Release: 44%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist}.alma.1
License: GPLv2+ and LGPLv2+
URL: https://github.com/ClusterLabs/resource-agents
Source0: %{upstream_prefix}-%{upstream_version}.tar.gz
@ -109,11 +109,9 @@ Patch56: bz2207567-Filesystem-2-fix-incorrect-parameter-types.patch
Patch57: bz2209433-Delay-1-increase-default-timeouts.patch
Patch58: bz2209433-Delay-2-remove-incorrect-statement.patch
Patch59: bz2207567-Filesystem-3-fix-signal_delay-default-value.patch
# Patches were taken from
# https://gitlab.com/redhat/centos-stream/rpms/resource-agents/-/commit/1cc6788b864876025836abed4d8132e52ac9c9ae#e5e2b05c719e98f752cb68e9c0600209785ffbc1
Patch44: bz2182415-azure-events-1-fix-no-transition-summary.patch
Patch45: bz2182415-azure-events-2-improve-logic.patch
# Patches were taken from:
# https://github.com/ClusterLabs/resource-agents/commit/cf2fd2a9cf06dc2e915f2fb5dbcc5e09e907a6df
Patch60: findif-sh-dont-use-table-parameter-as-it-returns-no-netmask.patch
# bundled ha-cloud-support libs
Patch500: ha-cloud-support-aws.patch
@ -297,6 +295,7 @@ exit 1
%patch57 -p1
%patch58 -p1
%patch59 -p1
%patch60 -p1
# bundled ha-cloud-support libs
%patch500 -p1
@ -618,6 +617,9 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents
%{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm
%changelog
* Tue Nov 07 2023 Eduard Abdullin <eabdullin@almalinux.org> - 4.10.0-44.alma.1
- findif.sh: dont use table parameter as it returns no netmask
* Thu Jul 20 2023 Oyvind Albrigtsen <oalbrigt@redhat.com> - 4.10.0-43
- Filesystem: improve stop-action and allow setting term/kill signals
and signal_delay for large filesystems