NOP make the message optional

Signed-off-by: Peter Lieven <pl@kamp.de>
This commit is contained in:
Peter Lieven
2012-11-28 18:44:22 +01:00
parent bd86570b4f
commit 5da6ea7275

View File

@@ -64,10 +64,12 @@ iscsi_nop_out_async(struct iscsi_context *iscsi, iscsi_command_cb cb,
pdu->callback = cb;
pdu->private_data = private_data;
if (iscsi_pdu_add_data(iscsi, pdu, data, len) != 0) {
iscsi_set_error(iscsi, "Failed to add outdata to nop-out");
iscsi_free_pdu(iscsi, pdu);
return -1;
if (data != NULL && len > 0) {
if (iscsi_pdu_add_data(iscsi, pdu, data, len) != 0) {
iscsi_set_error(iscsi, "Failed to add outdata to nop-out");
iscsi_free_pdu(iscsi, pdu);
return -1;
}
}
if (iscsi_queue_pdu(iscsi, pdu) != 0) {