lib: properly pass through NOP-In data segment

data_pos corresponds to the data_segment_length (+ padding), so should
always be passed to the NOP-In callback if greater than zero.

Fixes: https://github.com/sahlberg/libiscsi/issues/278

Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
David Disseldorp
2018-10-25 20:35:20 +02:00
parent 04d6c326b8
commit 15021faf19

View File

@@ -163,7 +163,7 @@ iscsi_process_nop_out_reply(struct iscsi_context *iscsi, struct iscsi_pdu *pdu,
data.data = NULL;
data.size = 0;
if (in->data_pos > ISCSI_HEADER_SIZE) {
if (in->data_pos) {
data.data = in->data;
data.size = in->data_pos;
}