diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2008-06-13 18:45:28 -0500 |
---|---|---|
committer | Mike Christie <michaelc@cs.wisc.edu> | 2008-06-13 18:45:28 -0500 |
commit | 612913b9ab774cef3fbc291305893f979f33aba0 (patch) | |
tree | e205f4d42abb45986bd34ad058463bf9d2f0de8a /usr/initiator.c | |
parent | 8e955128f5ba7b92d8e1c023ffde3f41a5a3eb28 (diff) | |
download | open-iscsi-612913b9ab774cef3fbc291305893f979f33aba0.tar.gz |
Fix login redirect failure handling.
If the login redirect fails, we currently retry forever.
This was because initiator.c could not figure out how
to best cleanup the mess. But now we do :) so this
patch allows the initiator to either retry the reopen or
fail.
Diffstat (limited to 'usr/initiator.c')
-rw-r--r-- | usr/initiator.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr/initiator.c b/usr/initiator.c index a14e6c6..4de618d 100644 --- a/usr/initiator.c +++ b/usr/initiator.c @@ -1619,8 +1619,13 @@ static void iscsi_recv_login_rsp(struct iscsi_conn *conn) return; retry: - /* force retry */ - session->r_stage = R_STAGE_SESSION_REOPEN; + /* + * If this is not the initial login attempt force a retry. If this + * is the initial attempt we follow the login_retry count. + */ + if (session->r_stage != R_STAGE_NO_CHANGE && + session->r_stage != R_STAGE_SESSION_REDIRECT) + session->r_stage = R_STAGE_SESSION_REOPEN; iscsi_login_eh(conn, c->qtask, MGMT_IPC_ERR_LOGIN_FAILURE); return; failed: |