Casting unsigned char * pointers to uint32_t * may cause wrong
results if the pointers are not correctly aligned. Instead,
build up the big-endian values from each byte with multiple
dereferences of the original pointer.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Assume target names are URL encoded with '%' as the special character.
Any sequence of '%' followed by two bytes in the target name will be replaced
with the byte that the second two bytes represent in hexadecimal.
Example
iqn.ronnie.test%3A1234
will be translated to iqn.ronnie.test:1234
The maximum number of blocks that can be transferred at once via a READ6
command is 256 instead of 265.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
The code that verifies the pr_type response must compare only the
lower four bits of byte 21 of the response ("TYPE") and must ignore
the upper four bits ("SCOPE").
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
If no reservation is held a SCSI target sends a response that is eight
bytes long while scsi-lowlevel.c fills in the first twelve bytes of a
data structure for which only eight bytes are allocated. Fix this buffer
overflow by always allocating a full
scsi_persistent_reserve_in_read_reservation structure.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Add a simple test that it works or is not implemented.
Add a RCTD test to verify that with this flag clear we get command descriptors without CTDP set and with it set we get command descriptors with CTDP set and a timeout descriptor
This makes sure that CHAP authentication is disabled if the system
is running in FIPS 140-2 mode. MD5 is not a secure algorithm according
to the standard.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Default to 0 meaning no timeout.
Implement a test for iSCS to test what happens if we send a command
with CMDSN being higher than the target allows.
In this case we dont strictly know what will happen, just that what should
NOT happen is the target responding with success.
But we have to be prepared for any kind of failure, including a timeout,
scsi sense, or even iscsi reject or session failure.
in case the maximum number of reconnects is limited with
iscsi_set_reconnect_max_retries() the an iscsi_context
is leaked if the limit is exhausted.
Signed-off-by: Peter Lieven <pl@kamp.de>
If the amount of reconnects is limited with iscsi_set_reconnect_max_retries()
it might happen that iscsi_reconnect is called while there is already a deferred
reconnect.
Signed-off-by: Peter Lieven <pl@kamp.de>
iscsi_data.size is used as parameter to memory
operation functions (such as malloc) which except
size_t rather than int.
Signed-off-by: Peter Lieven <pl@kamp.de>