[Pkg-iscsi-maintainers] [open-iscsi] 33/33: ISCSID: Added iface content override fix
Ritesh Raj Sarraf
rrs at alioth.debian.org
Tue Nov 5 16:21:20 UTC 2013
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 3b4b45001b6d8412aad76a55347de42d30d694f7
Author: Eddie Wai <eddie.wai at broadcom.com>
Date: Fri Aug 23 14:04:12 2013 -0700
ISCSID: Added iface content override fix
Patch provided by Mike Christie.
This patch fixes the unconditional overwrite of the iface struct
even when the corresponding iface info from the node config was
found and extracted.
Signed-off-by: Eddie Wai <eddie.wai at broadcom.com>
---
usr/iscsid.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/usr/iscsid.c b/usr/iscsid.c
index 8f19220..d1756ef 100644
--- a/usr/iscsid.c
+++ b/usr/iscsid.c
@@ -111,9 +111,7 @@ setup_rec_from_negotiated_values(node_rec_t *rec, struct session_info *info)
strlcpy(rec->name, info->targetname, TARGET_NAME_MAXLEN);
rec->conn[0].port = info->persistent_port;
strlcpy(rec->conn[0].address, info->persistent_address, NI_MAXHOST);
- memcpy(&rec->iface, &info->iface, sizeof(struct iface_rec));
rec->tpgt = info->tpgt;
- iface_copy(&rec->iface, &info->iface);
iscsi_sysfs_get_negotiated_session_conf(info->sid, &session_conf);
iscsi_sysfs_get_negotiated_conn_conf(info->sid, &conn_conf);
@@ -238,6 +236,7 @@ static int sync_session(void *data, struct session_info *info)
log_warning("Could not read data from db. Using default and "
"currently negotiated values\n");
setup_rec_from_negotiated_values(&rec, info);
+ iface_copy(&rec.iface, &info->iface);
} else {
/*
* we have a valid record and iface so lets merge
@@ -251,13 +250,12 @@ static int sync_session(void *data, struct session_info *info)
memset(&sysfsrec, 0, sizeof(node_rec_t));
setup_rec_from_negotiated_values(&sysfsrec, info);
/*
- * target, portal and iface name values have to be the same
+ * target, portal and iface values have to be the same
* or we would not have found the record, so just copy
- * CHAP and iface settings.
+ * CHAP settings.
*/
memcpy(&rec.session.auth, &sysfsrec.session.auth,
sizeof(struct iscsi_auth_config));
- memcpy(&rec.iface, &info->iface, sizeof(rec.iface));
}
/* multiple drivers could be connected to the same portal */
--
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