Blame SOURCES/bz1891883-ethmonitor-vlan-fix.patch

145c2a
From 7f7ca75100a846242ff1510fd9bcf299cd3d00eb Mon Sep 17 00:00:00 2001
145c2a
From: Aleksei Burlakov <aleksei.burlakov@suse.com>
145c2a
Date: Mon, 26 Oct 2020 13:25:45 +0100
145c2a
Subject: [PATCH] ethmonitor: is_interface: RE matches vlan names
145c2a
145c2a
Vlan names end not with : but are suffixed with the @devices-name
145c2a
---
145c2a
 heartbeat/ethmonitor | 4 ++--
145c2a
 1 file changed, 2 insertions(+), 2 deletions(-)
145c2a
145c2a
diff --git a/heartbeat/ethmonitor b/heartbeat/ethmonitor
145c2a
index e791fbe9d..cf0321ab4 100755
145c2a
--- a/heartbeat/ethmonitor
145c2a
+++ b/heartbeat/ethmonitor
145c2a
@@ -230,8 +230,8 @@ is_interface() {
145c2a
 	#
145c2a
 	# List interfaces but exclude FreeS/WAN ipsecN virtual interfaces
145c2a
 	#
145c2a
-	local iface=`$IP2UTIL -o -f inet addr show | grep " $1 " \
145c2a
-		| cut -d ' ' -f2 | sort -u | grep -v '^ipsec[0-9][0-9]*$'`
145c2a
+	local iface=`$IP2UTIL -o -f link addr show | grep -e " $1[:@]" \
145c2a
+		| cut -d ' ' -f2 | tr -d ':' | cut -d '@' -f1 | sort -u | grep -v '^ipsec[0-9][0-9]*$'`
145c2a
 		[ "$iface" != "" ]
145c2a
 }
145c2a