|
|
786c6d |
From 3b4b45001b6d8412aad76a55347de42d30d694f7 Mon Sep 17 00:00:00 2001
|
|
|
6c64be |
From: Eddie Wai <eddie.wai@broadcom.com>
|
|
|
786c6d |
Date: Fri, 23 Aug 2013 14:04:12 -0700
|
|
|
786c6d |
Subject: [PATCH] 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 |
--
|
|
|
786c6d |
1.8.3.1
|
|
|
6c64be |
|