Blame SOURCES/bz1408656-ethmonitor-monitor-interface-without-ip.patch

15862b
From 8ec7bd4cfcbdbff10c1c5717eae91d8c41037cda Mon Sep 17 00:00:00 2001
15862b
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
15862b
Date: Fri, 24 Mar 2017 12:56:23 +0100
15862b
Subject: [PATCH] ethmonitor: fix to be able to monitor interface without IP
15862b
15862b
---
15862b
 heartbeat/ethmonitor | 5 +++--
15862b
 1 file changed, 3 insertions(+), 2 deletions(-)
15862b
15862b
diff --git a/heartbeat/ethmonitor b/heartbeat/ethmonitor
15862b
index 7f5579f..81a7c0b 100755
15862b
--- a/heartbeat/ethmonitor
15862b
+++ b/heartbeat/ethmonitor
15862b
@@ -206,8 +206,9 @@ is_interface() {
15862b
 	#
15862b
 	# List interfaces but exclude FreeS/WAN ipsecN virtual interfaces
15862b
 	#
15862b
-	local iface=`$IP2UTIL -o -f inet addr show | grep " $1 " \
15862b
-		| cut -d ' ' -f2 | sort -u | grep -v '^ipsec[0-9][0-9]*$'`
15862b
+	local iface=`$IP2UTIL -o -f link addr show | grep " $1:" \
15862b
+		| cut -d ' ' -f2 | sort -u | grep -v '^ipsec[0-9][0-9]*$' \
15862b
+		| sed -e 's/:$//'`
15862b
 		[ "$iface" != "" ]
15862b
 }
15862b