Blame SOURCES/bz1939992-awsvip-dont-partially-match-IPs.patch

0c4b27
From 3491a6ad30830a8545defa5a417a7db46b093904 Mon Sep 17 00:00:00 2001
0c4b27
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
0c4b27
Date: Wed, 17 Mar 2021 12:39:10 +0100
0c4b27
Subject: [PATCH] awsvip: dont partially match similar IPs during
0c4b27
 monitor-action
0c4b27
0c4b27
---
0c4b27
 heartbeat/awsvip | 2 +-
0c4b27
 1 file changed, 1 insertion(+), 1 deletion(-)
0c4b27
0c4b27
diff --git a/heartbeat/awsvip b/heartbeat/awsvip
0c4b27
index 7d0bf35b6..044d049c6 100755
0c4b27
--- a/heartbeat/awsvip
0c4b27
+++ b/heartbeat/awsvip
0c4b27
@@ -172,7 +172,7 @@ awsvip_monitor() {
0c4b27
             --instance-id "${INSTANCE_ID}" \
0c4b27
             --query 'Reservations[].Instances[].NetworkInterfaces[].PrivateIpAddresses[].PrivateIpAddress[]' \
0c4b27
             --output text | \
0c4b27
-            grep -q "${SECONDARY_PRIVATE_IP}"
0c4b27
+            grep -qE "(^|\s)${SECONDARY_PRIVATE_IP}(\s|$)"
0c4b27
     RET=$?
0c4b27
 
0c4b27
     if [ $RET -ne 0 ]; then