Commit 7015e6b5 authored by Shuhei Matsumoto's avatar Shuhei Matsumoto Committed by Jim Harris
Browse files

lib/iscsi: Use rsp_pdu->data_buf_len in iscsi_op_login_rsp_handle()



Use rsp_pdu->data_buf_len in iscsi_op_login_rsp_handle() and its
calling functions.

This makes the code a little clearer.

Signed-off-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: I89aa7155e97c1b770b333f7f12e84e13811af953
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/471470


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
Reviewed-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-by: default avatarJim Harris <james.r.harris@intel.com>
parent 49f0d619
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -1927,7 +1927,7 @@ iscsi_op_login_store_incoming_params(struct spdk_iscsi_conn *conn,
static int
iscsi_op_login_rsp_handle_csg_bit(struct spdk_iscsi_conn *conn,
				  struct spdk_iscsi_pdu *rsp_pdu,
				  struct iscsi_param *params, int alloc_len)
				  struct iscsi_param *params)
{
	const char *auth_method;
	int rc;
@@ -1949,7 +1949,7 @@ iscsi_op_login_rsp_handle_csg_bit(struct spdk_iscsi_conn *conn,
			conn->authenticated = true;
		} else {
			rc = iscsi_auth_params(conn, params, auth_method,
					       rsp_pdu->data, alloc_len,
					       rsp_pdu->data, rsp_pdu->data_buf_len,
					       rsp_pdu->data_segment_len);
			if (rc < 0) {
				SPDK_ERRLOG("iscsi_auth_params() failed\n");
@@ -2120,15 +2120,15 @@ iscsi_op_login_rsp_handle_t_bit(struct spdk_iscsi_conn *conn,
 */
static int
iscsi_op_login_rsp_handle(struct spdk_iscsi_conn *conn,
			  struct spdk_iscsi_pdu *rsp_pdu, struct iscsi_param **params,
			  int alloc_len)
			  struct spdk_iscsi_pdu *rsp_pdu, struct iscsi_param **params)
{
	int rc;
	struct iscsi_bhs_login_rsp *rsph;
	rsph = (struct iscsi_bhs_login_rsp *)&rsp_pdu->bhs;

	/* negotiate parameters */
	rc = spdk_iscsi_negotiate_params(conn, params, rsp_pdu->data, alloc_len,
	rc = spdk_iscsi_negotiate_params(conn, params, rsp_pdu->data,
					 rsp_pdu->data_buf_len,
					 rsp_pdu->data_segment_len);
	if (rc < 0) {
		/*
@@ -2145,8 +2145,7 @@ iscsi_op_login_rsp_handle(struct spdk_iscsi_conn *conn,
	SPDK_LOGDUMP(SPDK_LOG_ISCSI, "Negotiated Params", rsp_pdu->data, rc);

	/* handle the CSG bit case */
	rc = iscsi_op_login_rsp_handle_csg_bit(conn, rsp_pdu, *params,
					       alloc_len);
	rc = iscsi_op_login_rsp_handle_csg_bit(conn, rsp_pdu, *params);
	if (rc < 0) {
		return rc;
	}
@@ -2207,7 +2206,7 @@ iscsi_op_login(struct spdk_iscsi_conn *conn, struct spdk_iscsi_pdu *pdu)
		}
	}

	rc = iscsi_op_login_rsp_handle(conn, rsp_pdu, &params, rsp_pdu->data_buf_len);
	rc = iscsi_op_login_rsp_handle(conn, rsp_pdu, &params);
	if (rc == SPDK_ISCSI_LOGIN_ERROR_RESPONSE) {
		iscsi_op_login_response(conn, rsp_pdu, params);
		return rc;