From 15021faf19ece8f586382016aed05540f9fe8028 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Thu, 25 Oct 2018 20:35:20 +0200 Subject: [PATCH] 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 --- lib/nop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nop.c b/lib/nop.c index b2104cd..b740c7f 100644 --- a/lib/nop.c +++ b/lib/nop.c @@ -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; }