[Pkg-iscsi-maintainers] [open-iscsi] 09/48: iscsi tools: Setup iface conf file with all iface attrs exported in sysfs

Ritesh Raj Sarraf rrs at moszumanska.debian.org
Wed Aug 20 13:54:08 UTC 2014


This is an automated email from the git hooks/post-receive script.

rrs pushed a commit to branch upstream-mnc
in repository open-iscsi.

commit 0a95bc409c6282b95c48ba39a16e17c3e6e26537
Author: Adheer Chandravanshi <adheer.chandravanshi at qlogic.com>
Date:   Fri Oct 18 09:29:17 2013 -0400

    iscsi tools: Setup iface conf file with all iface attrs exported in sysfs
    
    Currently, iface conf file does not get populated with all the iface
    attrs that are exported in corresponding sysfs entry.
    This patch allows to setup conf file with all iface attrs in sysfs.
    
    Signed-off-by: Adheer Chandravanshi <adheer.chandravanshi at qlogic.com>
    Signed-off-by: Vikas Chaudhary <vikas.chaudhary at qlogic.com>
---
 usr/iface.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/usr/iface.c b/usr/iface.c
index c86892e..8580d1a 100644
--- a/usr/iface.c
+++ b/usr/iface.c
@@ -476,11 +476,8 @@ static int iface_setup_binding_from_kern_iface(void *data,
 	}
 
 	memset(&iface, 0, sizeof(struct iface_rec));
-	strcpy(iface.hwaddress, hinfo->iface.hwaddress);
-	strcpy(iface.transport_name, hinfo->iface.transport_name);
-
 	if (kern_iface) {
-		iface.iface_num = kern_iface->iface_num;
+		memcpy(&iface, kern_iface, sizeof(iface));
 
 		snprintf(iface.name, sizeof(iface.name), "%s.%s.%s.%u",
 			 kern_iface->transport_name,
@@ -492,6 +489,9 @@ static int iface_setup_binding_from_kern_iface(void *data,
 			 hinfo->iface.transport_name, hinfo->iface.hwaddress);
 	}
 
+	strcpy(iface.hwaddress, hinfo->iface.hwaddress);
+	strcpy(iface.transport_name, hinfo->iface.transport_name);
+
 	memset(iface_path, 0, sizeof(iface_path));
 	snprintf(iface_path, PATH_MAX, "%s/%s", IFACE_CONFIG_DIR,
 		 iface.name);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-iscsi/open-iscsi.git



More information about the Pkg-iscsi-maintainers mailing list