Blame 0042-iscsi-tools-Setup-iface-conf-file-with-all-iface-att.patch

a288e4f
From 0a95bc409c6282b95c48ba39a16e17c3e6e26537 Mon Sep 17 00:00:00 2001
a288e4f
From: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
a288e4f
Date: Fri, 18 Oct 2013 09:29:17 -0400
a288e4f
Subject: [PATCH] iscsi tools: Setup iface conf file with all iface attrs
a288e4f
 exported in sysfs
a288e4f
a288e4f
Currently, iface conf file does not get populated with all the iface
a288e4f
attrs that are exported in corresponding sysfs entry.
a288e4f
This patch allows to setup conf file with all iface attrs in sysfs.
a288e4f
a288e4f
Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi@qlogic.com>
a288e4f
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
a288e4f
---
a288e4f
 usr/iface.c | 8 ++++----
a288e4f
 1 file changed, 4 insertions(+), 4 deletions(-)
a288e4f
a288e4f
diff --git a/usr/iface.c b/usr/iface.c
a288e4f
index c86892e..8580d1a 100644
a288e4f
--- a/usr/iface.c
a288e4f
+++ b/usr/iface.c
a288e4f
@@ -476,11 +476,8 @@ static int iface_setup_binding_from_kern_iface(void *data,
a288e4f
 	}
a288e4f
 
a288e4f
 	memset(&iface, 0, sizeof(struct iface_rec));
a288e4f
-	strcpy(iface.hwaddress, hinfo->iface.hwaddress);
a288e4f
-	strcpy(iface.transport_name, hinfo->iface.transport_name);
a288e4f
-
a288e4f
 	if (kern_iface) {
a288e4f
-		iface.iface_num = kern_iface->iface_num;
a288e4f
+		memcpy(&iface, kern_iface, sizeof(iface));
a288e4f
 
a288e4f
 		snprintf(iface.name, sizeof(iface.name), "%s.%s.%s.%u",
a288e4f
 			 kern_iface->transport_name,
a288e4f
@@ -492,6 +489,9 @@ static int iface_setup_binding_from_kern_iface(void *data,
a288e4f
 			 hinfo->iface.transport_name, hinfo->iface.hwaddress);
a288e4f
 	}
a288e4f
 
a288e4f
+	strcpy(iface.hwaddress, hinfo->iface.hwaddress);
a288e4f
+	strcpy(iface.transport_name, hinfo->iface.transport_name);
a288e4f
+
a288e4f
 	memset(iface_path, 0, sizeof(iface_path));
a288e4f
 	snprintf(iface_path, PATH_MAX, "%s/%s", IFACE_CONFIG_DIR,
a288e4f
 		 iface.name);
a288e4f
-- 
a288e4f
1.8.3.1
a288e4f