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

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