Blame SOURCES/bz1792160-fix-fault-rename-interface.patch

6a7e4c
From 30eeb48b1a0737dc7443fd421fd6613e0d55fd17 Mon Sep 17 00:00:00 2001
6a7e4c
From: "Z. Liu" <liuzx@knownsec.com>
6a7e4c
Date: Tue, 18 Dec 2018 16:38:24 +0800
6a7e4c
Subject: [PATCH] Also skip route not configured with down interface
6a7e4c
6a7e4c
Otherwise, if keepalived has virtual_routes configured, we create
6a7e4c
a virtual interface and bring it up and down, current code will bring
6a7e4c
VRRP state to FAULT and never return.
6a7e4c
6a7e4c
 # ip tun add test mode ipip remote 10.0.0.1 local 10.0.0.2
6a7e4c
 # ip link set test up
6a7e4c
 # ip link set test down
6a7e4c
---
6a7e4c
 keepalived/vrrp/vrrp_if.c | 4 +++-
6a7e4c
 1 file changed, 3 insertions(+), 1 deletion(-)
6a7e4c
6a7e4c
diff --git a/keepalived/vrrp/vrrp_if.c b/keepalived/vrrp/vrrp_if.c
6a7e4c
index a2087ceb..6ae2666a 100644
6a7e4c
--- a/keepalived/vrrp/vrrp_if.c
6a7e4c
+++ b/keepalived/vrrp/vrrp_if.c
6a7e4c
@@ -1051,7 +1051,9 @@ interface_down(interface_t *ifp)
6a7e4c
 			/* Any route that has an oif will be tracking the interface,
6a7e4c
 			 * so we only need to check for routes that dont specify an
6a7e4c
 			 * oif */
6a7e4c
-			if (!route->oif && route->configured_ifindex != ifp->ifindex)
6a7e4c
+			/* Don't track route if it's not configured with this down
6a7e4c
+			 * interface. */
6a7e4c
+			if (!route->oif || route->configured_ifindex != ifp->ifindex)
6a7e4c
 				continue;
6a7e4c
 
6a7e4c
 			route->set = false;
6a7e4c
-- 
6a7e4c
2.24.1
6a7e4c