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