mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 03:01:26 +00:00
It's better to perform target redirection only for allowed initiators.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1784 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -558,6 +558,18 @@ static void login_start(struct connection *conn)
|
||||
return;
|
||||
}
|
||||
|
||||
conn->tid = target->tid;
|
||||
|
||||
if (!config_initiator_access_allowed(conn->tid, conn->fd) ||
|
||||
!target_portal_allowed(target, conn->target_portal,
|
||||
conn->initiator) ||
|
||||
!isns_scn_access_allowed(conn->tid, name)) {
|
||||
log_info("Initiator %s not allowed to connect to "
|
||||
"target %s", name, target_name);
|
||||
login_rsp_ini_err(conn, ISCSI_STATUS_TGT_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
if (target_redirected(target, conn)) {
|
||||
struct iscsi_login_rsp_hdr *rsp =
|
||||
(struct iscsi_login_rsp_hdr *)&conn->rsp.bhs;
|
||||
@@ -572,18 +584,6 @@ static void login_start(struct connection *conn)
|
||||
return;
|
||||
}
|
||||
|
||||
conn->tid = target->tid;
|
||||
|
||||
if (!config_initiator_access_allowed(conn->tid, conn->fd) ||
|
||||
!target_portal_allowed(target, conn->target_portal,
|
||||
conn->initiator) ||
|
||||
!isns_scn_access_allowed(conn->tid, name)) {
|
||||
log_info("Initiator %s not allowed to connect to "
|
||||
"target %s", name, target_name);
|
||||
login_rsp_ini_err(conn, ISCSI_STATUS_TGT_NOT_FOUND);
|
||||
return;
|
||||
}
|
||||
|
||||
err = init_conn_session_params(conn);
|
||||
if (err != 0) {
|
||||
log_error("Can't get session params for session 0x%" PRIx64
|
||||
|
||||
Reference in New Issue
Block a user