Blame SOURCES/bz2029796-Route-return-OCF_NOT_RUNNING-missing-route.patch

811adb
From 7c54e4ecda33c90a1046c0688774f5b847ab10fe Mon Sep 17 00:00:00 2001
811adb
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
811adb
Date: Tue, 7 Dec 2021 10:37:24 +0100
811adb
Subject: [PATCH] Route: return OCF_NOT_RUNNING for probe action when interface
811adb
 or route doesnt exist
811adb
811adb
---
811adb
 heartbeat/Route | 15 +++++----------
811adb
 1 file changed, 5 insertions(+), 10 deletions(-)
811adb
811adb
diff --git a/heartbeat/Route b/heartbeat/Route
811adb
index 8b390615a..7db41d0ae 100755
811adb
--- a/heartbeat/Route
811adb
+++ b/heartbeat/Route
811adb
@@ -227,15 +227,6 @@ route_stop() {
811adb
 }
811adb
 
811adb
 route_status() {
811adb
-    if [ -n "${OCF_RESKEY_device}" ]; then
811adb
-	# Must check if device exists or is gone.
811adb
-	# If device is gone, route is also unconfigured.
811adb
-	ip link show dev ${OCF_RESKEY_device} >/dev/null 2>&1
811adb
-	if [ $? -ne 0 ]; then
811adb
-	    # Assume device does not exist, and short-circuit here.
811adb
-	    return $OCF_NOT_RUNNING
811adb
-	fi
811adb
-    fi
811adb
     show_output="$(ip $addr_family route show $(create_route_spec) 2>/dev/null)"
811adb
     if [ $? -eq 0 ]; then
811adb
 	if [ -n "$show_output" ]; then
811adb
@@ -251,7 +242,11 @@ route_status() {
811adb
     else
811adb
 	# "ip route show" returned an error code. Assume something
811adb
 	# went wrong.
811adb
-	return $OCF_ERR_GENERIC
811adb
+	if ocf_is_probe; then
811adb
+	    return $OCF_NOT_RUNNING
811adb
+	else
811adb
+	    return $OCF_ERR_GENERIC
811adb
+	fi
811adb
     fi
811adb
 }
811adb