Blame SOURCES/fcoe-utils-v1.0.29-34-fipvlan-Start-FCoE-on-existing-VLAN.patch

e343c9
From a9f6a0633096b2d08ed61ddbbbbbf00b76f0e5ee Mon Sep 17 00:00:00 2001
e343c9
From: Hannes Reinecke <hare@suse.de>
e343c9
Date: Wed, 28 Jan 2015 17:26:09 +0000
e343c9
Subject: [PATCH] fipvlan: Start FCoE on existing VLAN
e343c9
e343c9
If a VLAN already exists fipvlan wouldn't try to start FCoE here.
e343c9
e343c9
Signed-off-by: Hannes Reinecke <hare@suse.de>
e343c9
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
e343c9
---
e343c9
 fipvlan.c | 21 +++++++++++----------
e343c9
 1 file changed, 11 insertions(+), 10 deletions(-)
e343c9
e343c9
diff --git a/fipvlan.c b/fipvlan.c
e343c9
index 1feb41d..4937173 100644
e343c9
--- a/fipvlan.c
e343c9
+++ b/fipvlan.c
e343c9
@@ -630,17 +630,18 @@ create_and_start_vlan(struct fcf *fcf, bool vn2vn)
e343c9
 		if (vlan) {
e343c9
 			FIP_LOG_DBG("VLAN %s.%d already exists as %s\n",
e343c9
 				    real_dev->ifname, fcf->vlan, vlan->ifname);
e343c9
-			return 0;
e343c9
+			rc = 0;
e343c9
+		} else {
e343c9
+			snprintf(vlan_name, IFNAMSIZ, "%s.%d%s",
e343c9
+				 real_dev->ifname, fcf->vlan, config.suffix);
e343c9
+			rc = vlan_create(fcf->ifindex, fcf->vlan, vlan_name);
e343c9
+			if (rc < 0)
e343c9
+				printf("Failed to create VLAN device %s\n\t%s\n",
e343c9
+				       vlan_name, strerror(-rc));
e343c9
+			else
e343c9
+				printf("Created VLAN device %s\n", vlan_name);
e343c9
+			return rc;
e343c9
 		}
e343c9
-		snprintf(vlan_name, IFNAMSIZ, "%s.%d%s",
e343c9
-			 real_dev->ifname, fcf->vlan, config.suffix);
e343c9
-		rc = vlan_create(fcf->ifindex, fcf->vlan, vlan_name);
e343c9
-		if (rc < 0)
e343c9
-			printf("Failed to create VLAN device %s\n\t%s\n",
e343c9
-			       vlan_name, strerror(-rc));
e343c9
-		else
e343c9
-			printf("Created VLAN device %s\n", vlan_name);
e343c9
-		return rc;
e343c9
 	}
e343c9
 	if (!config.start)
e343c9
 		return rc;
e343c9
-- 
e343c9
2.1.0
e343c9