File open-iscsi-fix-daemon-segfault-due-to-bad-ptr-cast of Package open-iscsi

From 78616cb40257a05b69b3f34145dc768e62498777 Mon Sep 17 00:00:00 2001
From: Mike Christie <michaelc@cs.wisc.edu>
Date: Sat, 27 Jun 2009 17:18:38 -0500
Subject: [PATCH] iscsid: fix segault due to bad conn_context data ptr casting

Establish a connection to an MD3000i (use CHAP and Rev. CHAP)
	- Disconnect the iSCSI session
		iscsiadm -m node -p <ip_addr> -T <iqn> -u
	- Reconnect the iSCSI session
		iscsiadm -m node -p <ip_addr> -T <iqn> -l
<-------------Fails because iscsid gets killed

Signed-off-by: Thomas Chenault <thomas_chenault@dell.com>
Tested-by: Shyam Iyer <shyam_iyer@dell.com>
---
 usr/initiator.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/usr/initiator.c b/usr/initiator.c
index d703a4a..f05b87c 100644
--- a/usr/initiator.c
+++ b/usr/initiator.c
@@ -117,7 +117,7 @@ struct iscsi_conn_context *iscsi_conn_context_get(iscsi_conn_t *conn,
 				sizeof(struct actor));
 			conn_context->allocated = 1;
 			/* some callers abuse this pointer */
-			conn_context->data = conn_context +
+			conn_context->data = (void *)conn_context +
 					sizeof(struct iscsi_conn_context);
 			log_debug(7, "get conn context %p",
 				  &conn_context->actor);
-- 
1.6.0.2