Limit immediate and unsolicited data to FirstBurstLength
RFC3270 describes in section 12.14 that immediate and unsolicited data sent from the initiator to the target must not exceed FristBurstLength bytes in total.
This commit is contained in:
@@ -242,8 +242,8 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
|
||||
if (iscsi->use_immediate_data == ISCSI_IMMEDIATE_DATA_YES) {
|
||||
uint32_t len = data.size;
|
||||
|
||||
if (len > iscsi->target_max_recv_data_segment_length) {
|
||||
len = iscsi->target_max_recv_data_segment_length;
|
||||
if (len > iscsi->first_burst_length) {
|
||||
len = iscsi->first_burst_length;
|
||||
}
|
||||
|
||||
if (iscsi_pdu_add_data(iscsi, pdu, data.data, len)
|
||||
@@ -302,7 +302,7 @@ iscsi_scsi_command_async(struct iscsi_context *iscsi, int lun,
|
||||
}
|
||||
|
||||
/* Can we send some unsolicited data ? */
|
||||
if (pdu->nidata.size != 0 && iscsi->use_initial_r2t == ISCSI_INITIAL_R2T_NO) {
|
||||
if (pdu->nidata.size != 0 && iscsi->use_initial_r2t == ISCSI_INITIAL_R2T_NO && iscsi->use_immediate_data == ISCSI_IMMEDIATE_DATA_NO) {
|
||||
uint32_t len = pdu->nidata.size - offset;
|
||||
|
||||
if (len > iscsi->first_burst_length) {
|
||||
|
||||
Reference in New Issue
Block a user