From b49251f89db2119360f251bff7d7f773218bac05 Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen Date: Thu, 8 Feb 2024 11:34:14 +0100 Subject: [PATCH] - findif.sh: fix loopback IP handling Resolves: RHEL-15304 --- ...04-1-findif.sh-fix-loopback-handling.patch | 0 ...2-findif.sh-dont-use-table-parameter.patch | 20 +++++++++++++++++++ resource-agents.spec | 13 ++++++++---- 3 files changed, 29 insertions(+), 4 deletions(-) rename RHEL-15304-findif.sh-fix-loopback-handling.patch => RHEL-15304-1-findif.sh-fix-loopback-handling.patch (100%) create mode 100644 RHEL-15304-2-findif.sh-dont-use-table-parameter.patch diff --git a/RHEL-15304-findif.sh-fix-loopback-handling.patch b/RHEL-15304-1-findif.sh-fix-loopback-handling.patch similarity index 100% rename from RHEL-15304-findif.sh-fix-loopback-handling.patch rename to RHEL-15304-1-findif.sh-fix-loopback-handling.patch diff --git a/RHEL-15304-2-findif.sh-dont-use-table-parameter.patch b/RHEL-15304-2-findif.sh-dont-use-table-parameter.patch new file mode 100644 index 0000000..29dba3b --- /dev/null +++ b/RHEL-15304-2-findif.sh-dont-use-table-parameter.patch @@ -0,0 +1,20 @@ +--- a/heartbeat/findif.sh 2024-02-08 11:31:53.414257686 +0100 ++++ b/heartbeat/findif.sh 2023-11-02 10:20:12.150853167 +0100 +@@ -210,14 +210,14 @@ + 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 diff --git a/resource-agents.spec b/resource-agents.spec index b8453f8..5d11b08 100644 --- a/resource-agents.spec +++ b/resource-agents.spec @@ -45,7 +45,7 @@ Name: resource-agents Summary: Open Source HA Reusable Cluster Resource Scripts Version: 4.10.0 -Release: 51%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} +Release: 52%{?rcver:%{rcver}}%{?numcomm:.%{numcomm}}%{?alphatag:.%{alphatag}}%{?dirty:.%{dirty}}%{?dist} License: GPLv2+ and LGPLv2+ URL: https://github.com/ClusterLabs/resource-agents Source0: %{upstream_prefix}-%{upstream_version}.tar.gz @@ -114,10 +114,11 @@ Patch61: rhel-979-storage-mon-1-daemon-mode.patch Patch62: rhel-979-storage-mon-2-remove-unnecessary-code.patch Patch63: RHEL-15301-1-exportfs-make-fsid-optional.patch Patch64: RHEL-15301-2-ocft-exportfs-remove-fsid-required-test.patch -Patch65: RHEL-15304-findif.sh-fix-loopback-handling.patch +Patch65: RHEL-15304-1-findif.sh-fix-loopback-handling.patch Patch66: RHEL-16247-aws-vpc-move-ip-aws-vpc-route53-awseip-awsvip-auth_type-role.patch Patch67: RHEL-17072-1-storage_mon-findif-leak-unitialized-values-EOS-fixes.patch Patch68: RHEL-17072-2-storage_mon-use-memset-to-fix-covscan-error.patch +Patch69: RHEL-15304-2-findif.sh-dont-use-table-parameter.patch # bundled ha-cloud-support libs Patch500: ha-cloud-support-aws.patch @@ -310,6 +311,7 @@ exit 1 %patch -p1 -P 66 %patch -p1 -P 67 %patch -p1 -P 68 +%patch -p1 -P 69 # bundled ha-cloud-support libs %patch -p1 -P 500 @@ -631,6 +633,11 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents %{_usr}/lib/ocf/lib/heartbeat/OCF_*.pm %changelog +* Thu Feb 8 2024 Oyvind Albrigtsen - 4.10.0-52 +- findif.sh: fix loopback IP handling + + Resolves: RHEL-15304 + * Wed Nov 22 2023 Oyvind Albrigtsen - 4.10.0-51 - storage_mon/findif: fix handler out of scope leak, unitialized value and check that netmaskbits != EOS @@ -645,10 +652,8 @@ rm -rf %{buildroot}/usr/share/doc/resource-agents * Thu Nov 2 2023 Oyvind Albrigtsen - 4.10.0-47 - exportfs: make "fsid" parameter optional -- findif.sh: fix loopback IP handling Resolves: RHEL-15301 - Resolves: RHEL-15304 * Mon Oct 2 2023 Oyvind Albrigtsen - 4.10.0-46 - storage-mon: add daemon-mode to deal with I/O hangs