Blame SOURCES/findif-only-match-lines-with-netmasks.patch

05afe3
From 2437d3879270f8febc5353e09898dd7d0aee08af Mon Sep 17 00:00:00 2001
05afe3
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
05afe3
Date: Wed, 1 Aug 2018 09:54:39 +0200
05afe3
Subject: [PATCH] findif: only match lines containing netmasks
05afe3
05afe3
---
05afe3
 heartbeat/findif.sh | 4 ++--
05afe3
 1 file changed, 2 insertions(+), 2 deletions(-)
05afe3
05afe3
diff --git a/heartbeat/findif.sh b/heartbeat/findif.sh
05afe3
index fc84cf0ec..66bc6d56a 100644
05afe3
--- a/heartbeat/findif.sh
05afe3
+++ b/heartbeat/findif.sh
05afe3
@@ -215,9 +215,9 @@ findif()
05afe3
   fi
05afe3
   if [ -n "$nic" ] ; then
05afe3
     # NIC supports more than two.
05afe3
-    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}')
05afe3
+    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}')
05afe3
   else
05afe3
-    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}')
05afe3
+    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}')
05afe3
   fi
05afe3
   if [ $# = 0 ] ; then
05afe3
     case $OCF_RESKEY_ip in