[Stgt-devel] [PATCH] isns fix initiator -> target

FUJITA Tomonori tomof
Sun Sep 16 07:38:15 CEST 2007


From: Albert Pauw <albert.pauw at gmail.com>
Subject: [Stgt-devel] [PATCH] isns fix initiator -> target
Date: Sat, 15 Sep 2007 22:28:01 +0200

> Here's a little patch for the isns part.
> 
> Seems that when incorporating the open-iscsi isns stuf in tgt the change 
> from initiator type to target type was forgotton.

No.


> In particular
> 
> file usr/iscsi/isns.c
> 
> ISNS_NODE_INITIATOR -> ISNS_NODE_TARGET
> ISNS_SCN_FLAG_INITIATOR -> ISNS_SCN_FLAG_TARGET
> 
> There are quite a few local parameters left in with initiator in the 
> name, but I left those in, this patch only let tgt tell to isns that it 
> is a target.

Please send a patch as inline text in the body of the email.


--- usr/iscsi/isns.c	2007-09-05 20:38:55.000000000 +0200
+++ usr/iscsi/isns.c.new	2007-09-15 22:19:49.000000000 +0200
@@ -265,7 +265,7 @@
 	length += isns_tlv_set(&tlv, ISNS_ATTR_ISCSI_NAME, strlen(name), name);
 	length += isns_tlv_set(&tlv, 0, 0, 0);
 
-	scn_flags = ISNS_SCN_FLAG_INITIATOR | ISNS_SCN_FLAG_OBJECT_REMOVE |
+	scn_flags = ISNS_SCN_FLAG_TARGET | ISNS_SCN_FLAG_OBJECT_REMOVE |
 		ISNS_SCN_FLAG_OBJECT_ADDED | ISNS_SCN_FLAG_OBJECT_UPDATED;

No. We register SCN to monitor initiators.


 	set_scn_flag(scn_flags);
 	scn_flags = htonl(scn_flags);
@@ -291,7 +291,7 @@
 	struct isns_hdr *hdr = (struct isns_hdr *) buf;
 	struct isns_tlv *tlv;
 	struct iscsi_target *target;
-	uint32_t node = htonl(ISNS_NODE_INITIATOR);
+	uint32_t node = htonl(ISNS_NODE_TARGET);
 	struct isns_qry_mgmt *mgmt;
 
No, we send a query about initiators.


 	if (list_empty(&iscsi_targets_list))
@@ -681,7 +681,7 @@
 			name = (char *) tlv->value;
 			break;
 		case ISNS_ATTR_ISCSI_NODE_TYPE:
-			if (ntohl(*(tlv->value)) == ISNS_NODE_INITIATOR && name) {
+			if (ntohl(*(tlv->value)) == ISNS_NODE_TARGET && name) {
 				eprintf("%s\n", (char *) name);
 				ini = malloc(sizeof(*ini));
 				if (!ini)

No, we handle the response to the query about initiators.



More information about the stgt mailing list