You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
3.6 KiB
80 lines
3.6 KiB
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
|