[stgt] [PATCH] iser: Fix bidirectional chap

Shlomo Pongratz shlomop at mellanox.com
Wed Jun 12 09:38:25 CEST 2013

When bidirectional chap is used, after the authentication phase is completed, the next
message from the target to the initiator should contain only the session parameters.
Currently it is wrongly prefixed with part of the previous message (which contained
authentication data). Fix that by initializing tx_pdu->membuf.size to zero before any
message is created in iser_login_exec.

Signed-off-by: Shlomo Pongratz <shlomop at mellanox.com>
 usr/iscsi/iser_text.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/usr/iscsi/iser_text.c b/usr/iscsi/iser_text.c
index b931f34..c76501a 100644
--- a/usr/iscsi/iser_text.c
+++ b/usr/iscsi/iser_text.c
@@ -610,6 +610,8 @@ void iser_login_exec(struct iscsi_connection *iscsi_conn,
 	struct iscsi_login_rsp *rsp_bhs = (struct iscsi_login_rsp *)tx_pdu->bhs;
 	int stay = 0, nsg_disagree = 0;
+	tx_pdu->membuf.size = 0;
 	memset(rsp_bhs, 0, BHS_SIZE);
 	if ((req_bhs->opcode & ISCSI_OPCODE_MASK) != ISCSI_OP_LOGIN ||
 	    !(req_bhs->opcode & ISCSI_OP_IMMEDIATE)) {

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