Skip to content

Commit

Permalink
iscsi-command: fix unsolicited data-out length
Browse files Browse the repository at this point in the history
the recent implementation allows to send
iscsi->first_burst_length + iscsi->target_max_recv_data_segment_length
bytes if immediate and unsolicited data-out is send and
iscsi->target_max_recv_data_segment_length < iscsi->first_burst_length.

RFC3720 defines the length as:

Length=(min(FirstBurstLength, Expected Data
   Transfer Length) - Received Immediate Data Length).

so that immediate data and unsolicited data-out are together
FirstBurstLength at maximum.

Signed-off-by: Peter Lieven <pl@kamp.de>
  • Loading branch information
plieven committed Feb 23, 2015
1 parent c94fb84 commit dd6831a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/iscsi-command.c
Expand Up @@ -193,11 +193,8 @@ iscsi_timeout_scan(struct iscsi_context *iscsi)
int
iscsi_send_unsolicited_data_out(struct iscsi_context *iscsi, struct iscsi_pdu *pdu)
{
uint32_t len = pdu->expxferlen - pdu->payload_len;
uint32_t len = MIN(pdu->expxferlen, iscsi->first_burst_length) - pdu->payload_len;

if (len > iscsi->first_burst_length) {
len = iscsi->first_burst_length;
}
return iscsi_send_data_out(iscsi, pdu, 0xffffffff,
pdu->payload_len, len);
}
Expand Down

0 comments on commit dd6831a

Please sign in to comment.