[stgt] [PATCH] Fix a problem w.r.t registering second target to the iSNS Server

Chandra Seetharaman sekharan at us.ibm.com
Wed Aug 11 23:40:58 CEST 2010


The latest changes to iSNS module in stgt made stgt to fail registering
the second target to Microsoft iSNS Server (registering with open-isns
works fine).

Specifically, the change to use name of the target being registered 
instead of the first target's name.

ISNS_FUNC_DEV_ATTR_REG fails with ISNS_STATUS_SOURCE_UNAUTHORIZED
ISNS_FUNC_DEV_ATTR_QRY and ISNS_FUNC_SCN_REG fails with
ISNS_STATUS_SOURCE_UNKNOWN.

This patch reverts the change to use the first target's name for all
target registrations.

Signed-Off-By: Chandra Seetharaman <sekharan at us.ibm.com>
---
 usr/iscsi/isns.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: tgt-469b574/usr/iscsi/isns.c
===================================================================
--- tgt-469b574.orig/usr/iscsi/isns.c
+++ tgt-469b574/usr/iscsi/isns.c
@@ -343,6 +343,7 @@ int isns_target_register(char *name)
 	uint16_t flags = 0, length = 0;
 	struct isns_hdr *hdr = (struct isns_hdr *) buf;
 	struct isns_tlv *tlv;
+	struct iscsi_target *target;
 	uint32_t port = htonl(iscsi_listen_port);
 	uint32_t node = htonl(ISNS_NODE_TARGET);
 	uint32_t type = htonl(2);
@@ -358,7 +359,10 @@ int isns_target_register(char *name)
 	memset(buf, 0, sizeof(buf));
 	tlv = (struct isns_tlv *) hdr->pdu;
 
-	length += isns_tlv_set_string(&tlv, ISNS_ATTR_ISCSI_NAME, name);
+	target = list_first_entry(&iscsi_targets_list,
+				struct iscsi_target, tlist);
+	length += isns_tlv_set_string(&tlv, ISNS_ATTR_ISCSI_NAME,
+					tgt_targetname(target->tid));
 	length += isns_tlv_set_string(&tlv, ISNS_ATTR_ENTITY_IDENTIFIER, eid);
 
 	length += isns_tlv_set(&tlv, 0, 0, 0);


--
To unsubscribe from this list: send the line "unsubscribe stgt" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html



More information about the stgt mailing list