From 819248a51951c119253c1a70fe17c5fd94451735 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sat, 2 Jun 2012 15:41:38 +1000 Subject: [PATCH] LOGIN: Dont increment the ITT if the target wants another round of LOGIN If the login phase takes multiple login requests we should keep the ITT the same for all login requets and not increment it. A multi-phase login is only a single task eventhough it may be spread across multiple login requetst. While most targets are forgiving and still work if we increment the ITT for each login command, some targets such as SOLARIS/COMSTAR is NOT forgiving if we break the protocol in this situation. Fix the ITT handling so that we dont make SOLARIS/COMSTAR upset. Signed-off-by: Ronnie Sahlberg --- lib/login.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/login.c b/lib/login.c index dd3beb4..ff271f0 100644 --- a/lib/login.c +++ b/lib/login.c @@ -735,8 +735,10 @@ iscsi_login_async(struct iscsi_context *iscsi, iscsi_command_cb cb, return -1; } - pdu = iscsi_allocate_pdu(iscsi, ISCSI_PDU_LOGIN_REQUEST, - ISCSI_PDU_LOGIN_RESPONSE); + pdu = iscsi_allocate_pdu_with_itt_flags(iscsi, + ISCSI_PDU_LOGIN_REQUEST, + ISCSI_PDU_LOGIN_RESPONSE, + iscsi->itt, 0); if (pdu == NULL) { iscsi_set_error(iscsi, "Out-of-memory: Failed to allocate " "login pdu.");