Blame SOURCES/0042-ISCSID-Added-iface-content-override-fix.patch

6c64be
From ec7d79ed691619b6ffa8c25f162ce62e1e25e6c1 Mon Sep 17 00:00:00 2001
6c64be
From: Eddie Wai <eddie.wai@broadcom.com>
6c64be
Date: Fri, 12 Apr 2013 10:41:17 -0700
6c64be
Subject: ISCSID: Added iface content override fix
6c64be
6c64be
Patch provided by Mike Christie.
6c64be
6c64be
This patch fixes the unconditional overwrite of the iface struct
6c64be
even when the corresponding iface info from the node config was
6c64be
found and extracted.
6c64be
6c64be
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
6c64be
---
6c64be
 usr/iscsid.c | 8 +++-----
6c64be
 1 file changed, 3 insertions(+), 5 deletions(-)
6c64be
6c64be
diff --git a/usr/iscsid.c b/usr/iscsid.c
6c64be
index 8f19220..d1756ef 100644
6c64be
--- a/usr/iscsid.c
6c64be
+++ b/usr/iscsid.c
6c64be
@@ -111,9 +111,7 @@ setup_rec_from_negotiated_values(node_rec_t *rec, struct session_info *info)
6c64be
 	strlcpy(rec->name, info->targetname, TARGET_NAME_MAXLEN);
6c64be
 	rec->conn[0].port = info->persistent_port;
6c64be
 	strlcpy(rec->conn[0].address, info->persistent_address, NI_MAXHOST);
6c64be
-	memcpy(&rec->iface, &info->iface, sizeof(struct iface_rec));
6c64be
 	rec->tpgt = info->tpgt;
6c64be
-	iface_copy(&rec->iface, &info->iface);
6c64be
 
6c64be
 	iscsi_sysfs_get_negotiated_session_conf(info->sid, &session_conf);
6c64be
 	iscsi_sysfs_get_negotiated_conn_conf(info->sid, &conn_conf);
6c64be
@@ -238,6 +236,7 @@ static int sync_session(void *data, struct session_info *info)
6c64be
 		log_warning("Could not read data from db. Using default and "
6c64be
 			    "currently negotiated values\n");
6c64be
 		setup_rec_from_negotiated_values(&rec, info);
6c64be
+		iface_copy(&rec.iface, &info->iface);
6c64be
 	} else {
6c64be
 		/*
6c64be
 		 * we have a valid record and iface so lets merge
6c64be
@@ -251,13 +250,12 @@ static int sync_session(void *data, struct session_info *info)
6c64be
 		memset(&sysfsrec, 0, sizeof(node_rec_t));
6c64be
 		setup_rec_from_negotiated_values(&sysfsrec, info);
6c64be
 		/*
6c64be
-		 * target, portal and iface name values have to be the same
6c64be
+		 * target, portal and iface values have to be the same
6c64be
 		 * or we would not have found the record, so just copy
6c64be
-		 * CHAP and iface settings.
6c64be
+		 * CHAP settings.
6c64be
 		 */
6c64be
 		memcpy(&rec.session.auth, &sysfsrec.session.auth,
6c64be
 		      sizeof(struct iscsi_auth_config));
6c64be
-		memcpy(&rec.iface, &info->iface, sizeof(rec.iface));
6c64be
 	}
6c64be
 
6c64be
 	/* multiple drivers could be connected to the same portal */
6c64be
-- 
6c64be
1.8.1.4
6c64be