File 0004-fipvlan-Only-shutdown-interfaces-if-no-vlans-are-cre.patch of Package fcoe-utils

From 29d172232050386b456da62bf873278bb90d4676 Mon Sep 17 00:00:00 2001
From: Hannes Reinecke <hare@suse.de>
Date: Tue, 19 Nov 2013 20:26:01 +0000
Subject: fipvlan: Only shutdown interfaces if no vlans are created

Instead of having to check the individual stages we can
easier just check if any vlans are created. Vlans are
only created if the user specified '--create', so if
no VLANs are created either the user has not specified
it or some error occured along the line. In either case
we can shutdown the interface.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Robert Love <robert.w.love@intel.com>
---
 fipvlan.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fipvlan.c b/fipvlan.c
index e51358f..4559e07 100644
--- a/fipvlan.c
+++ b/fipvlan.c
@@ -857,8 +857,7 @@ static void cleanup_interfaces(void)
 
 	if (config.automode) {
 		TAILQ_FOREACH(iff, &interfaces, list_node) {
-			if (iff->linkup_sent &&
-			    (!iff->running || !iff->req_sent || !iff->resp_recv)) {
+			if (iff->linkup_sent && TAILQ_EMPTY(&iff->vlans)) {
 				FIP_LOG_DBG("shutdown if %d",
 					    iff->ifindex);
 				rtnl_set_iff_down(iff->ifindex, NULL);
@@ -872,8 +871,7 @@ static void cleanup_interfaces(void)
 				skipped++;
 				continue;
 			}
-			if (iff->linkup_sent &&
-			    (!iff->running || !iff->req_sent || !iff->resp_recv)) {
+			if (iff->linkup_sent && TAILQ_EMPTY(&iff->vlans)) {
 				FIP_LOG_DBG("shutdown if %d",
 					    iff->ifindex);
 				rtnl_set_iff_down(iff->ifindex, NULL);
-- 
1.8.1.4
openSUSE Build Service is sponsored by