- findif.sh: fix loopback IP handling

Resolves: RHEL-15304
This commit is contained in:
Oyvind Albrigtsen 2024-02-08 11:34:14 +01:00
parent 568498666b
commit b49251f89d
3 changed files with 29 additions and 4 deletions

View File

@ -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

View File

@ -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 <oalbrigt@redhat.com> - 4.10.0-52
- findif.sh: fix loopback IP handling
Resolves: RHEL-15304
* Wed Nov 22 2023 Oyvind Albrigtsen <oalbrigt@redhat.com> - 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 <oalbrigt@redhat.com> - 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 <oalbrigt@redhat.com> - 4.10.0-46
- storage-mon: add daemon-mode to deal with I/O hangs