From da9e8e691f39494e14f8f11173b6ab6433384396 Mon Sep 17 00:00:00 2001 From: Oyvind Albrigtsen Date: Tue, 20 Jun 2023 14:19:23 +0200 Subject: [PATCH] findif.sh: fix table parameter so it uses main table by default --- heartbeat/findif.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/heartbeat/findif.sh b/heartbeat/findif.sh index 1a40cc9a4b..6c04c98c19 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=local}" scope host | (while read line; + ip -o -f inet route list match $OCF_RESKEY_ip table "${OCF_RESKEY_table:=main}" scope host | (while read line; do netinfo=`echo $line | awk '{print $2}'` case $netinfo in @@ -215,9 +215,9 @@ findif() fi if [ -n "$nic" ] ; then # NIC supports more than two. - 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}') + 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}') else - 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}') + 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}') fi if [ $# = 0 ] ; then case $OCF_RESKEY_ip in