Use an initiator specific and one target specific value for MaxRecvDataSegmentLength
This commit is contained in:
@@ -95,7 +95,8 @@ struct iscsi_context {
|
||||
|
||||
uint32_t max_burst_length;
|
||||
uint32_t first_burst_length;
|
||||
uint32_t max_recv_data_segment_length;
|
||||
uint32_t initiator_max_recv_data_segment_length;
|
||||
uint32_t target_max_recv_data_segment_length;
|
||||
enum iscsi_initial_r2t want_initial_r2t;
|
||||
enum iscsi_initial_r2t use_initial_r2t;
|
||||
enum iscsi_initial_r2t want_immediate_data;
|
||||
|
||||
15
lib/init.c
15
lib/init.c
@@ -60,13 +60,14 @@ iscsi_create_context(const char *initiator_name)
|
||||
iscsi->next_phase = ISCSI_PDU_LOGIN_NSG_OPNEG;
|
||||
iscsi->secneg_phase = ISCSI_LOGIN_SECNEG_PHASE_OFFER_CHAP;
|
||||
|
||||
iscsi->max_burst_length = 262144;
|
||||
iscsi->first_burst_length = 262144;
|
||||
iscsi->max_recv_data_segment_length = 262144;
|
||||
iscsi->want_initial_r2t = ISCSI_INITIAL_R2T_NO;
|
||||
iscsi->use_initial_r2t = ISCSI_INITIAL_R2T_NO;
|
||||
iscsi->want_immediate_data = ISCSI_IMMEDIATE_DATA_YES;
|
||||
iscsi->use_immediate_data = ISCSI_IMMEDIATE_DATA_YES;
|
||||
iscsi->max_burst_length = 262144;
|
||||
iscsi->first_burst_length = 262144;
|
||||
iscsi->initiator_max_recv_data_segment_length = 262144;
|
||||
iscsi->target_max_recv_data_segment_length = 8192;
|
||||
iscsi->want_initial_r2t = ISCSI_INITIAL_R2T_NO;
|
||||
iscsi->use_initial_r2t = ISCSI_INITIAL_R2T_NO;
|
||||
iscsi->want_immediate_data = ISCSI_IMMEDIATE_DATA_YES;
|
||||
iscsi->use_immediate_data = ISCSI_IMMEDIATE_DATA_YES;
|
||||
|
||||
return iscsi;
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ iscsi_login_add_maxrecvdatasegmentlength(struct iscsi_context *iscsi, struct isc
|
||||
return 0;
|
||||
}
|
||||
|
||||
asprintf(&str, "MaxRecvDataSegmentLength=%d", iscsi->max_recv_data_segment_length);
|
||||
asprintf(&str, "MaxRecvDataSegmentLength=%d", iscsi->initiator_max_recv_data_segment_length);
|
||||
if (iscsi_pdu_add_data(iscsi, pdu, (unsigned char *)str, strlen(str)+1)
|
||||
!= 0) {
|
||||
iscsi_set_error(iscsi, "Out-of-memory: pdu add data failed.");
|
||||
@@ -958,7 +958,7 @@ iscsi_process_login_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
|
||||
}
|
||||
|
||||
if (!strncmp((char *)ptr, "MaxRecvDataSegmentLength=", 25)) {
|
||||
iscsi->max_recv_data_segment_length = strtol((char *)ptr + 25, NULL, 10);
|
||||
iscsi->target_max_recv_data_segment_length = strtol((char *)ptr + 25, NULL, 10);
|
||||
}
|
||||
|
||||
if (!strncmp((char *)ptr, "AuthMethod=", 11)) {
|
||||
|
||||
Reference in New Issue
Block a user