Ronnie Sahlberg
49698e0322
Dont fail the login just because a sanitize is in progress
2013-07-21 14:04:41 -07:00
Ronnie Sahlberg
804c5b0211
Dont reference *pdu after it has been freed
2013-07-21 13:29:43 -07:00
Ronnie Sahlberg
83a0cd90f9
Add SANITIZE_IN_PROGRESS ASCQ
2013-07-21 09:55:35 -07:00
Ronnie Sahlberg
52a83e91af
Add POWER_CONDITION modepage marshalling/unmarshalling
2013-07-20 15:35:38 -07:00
Ronnie Sahlberg
fd38ff4bfc
Add MODESENSE6/10 and MODESELECT6/10 support
2013-07-20 14:05:20 -07:00
Ronnie Sahlberg
e556a0399b
SCSI MODESELECT: leave the 4/8 byte header completely blank.
...
The convention is to not fill this header in when sending modeselect to a target
2013-07-20 09:08:52 -07:00
Ronnie Sahlberg
cc02faabb0
Add TCP_CORK support when available
2013-07-10 14:14:36 -07:00
Ronnie Sahlberg
9e9ca71247
Modesense6 decoding bugs, start preparing for modesense10 decoding
2013-07-08 01:31:03 -07:00
Ronnie Sahlberg
ebb1f06830
Add parameter list length error sense code
2013-07-06 23:35:03 -07:00
Ronnie Sahlberg
a51d706d32
Add invalid field in parameter list sense code
2013-07-06 22:35:36 -07:00
Ronnie Sahlberg
7895fb700c
Add MODESELECT6 support
...
Add support for MODESELECT6 and add marshalling functions for the
mode pages we support so far.
2013-07-06 16:11:17 -07:00
Ronnie Sahlberg
b6e5af558d
Unmarshall support for Control modepage
2013-07-05 22:38:45 -07:00
Ronnie Sahlberg
3edd40953e
TESTS: SANITIZE, Add tests for WABEREQ/WACEREQ
2013-07-05 14:25:43 -07:00
Paolo Bonzini
0a7c084603
scsi-lowlevel: do not use unsafe pointer casts
...
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 >
2013-07-01 16:00:25 +02:00
Ronnie Sahlberg
8140c5b726
Flag another argument as _U_
2013-06-29 11:20:23 -07:00
Ronnie Sahlberg
bc7b1dc600
Add _U_ to some variables that might be unused
2013-06-29 11:14:46 -07:00
Ronnie Sahlberg
b555bbebdd
Add a cast to ssize_t
2013-06-29 11:12:41 -07:00
Ronnie Sahlberg
21a6a08814
Update libiscsi.def/.syms for iscsi_set_bind_interfaces
...
Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com >
2013-06-25 20:15:35 -07:00
Ronnie Sahlberg
e061cba1b9
URL encoded Targetnames
...
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
2013-06-16 11:35:14 -07:00
Bart Van Assche
49d1145a10
Next to BUS RESET, also accept NEXUS LOSS unit attention after login
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
2013-06-08 07:44:43 -07:00
Ronnie Sahlberg
dcb9504ec0
READ6, make the truncation from a potantial 9-bit value (0-256) to 8 bits
...
explicit by masking it with 0xff instead of relying on obscure truncation
rules.
2013-05-30 19:29:53 -07:00
Bart Van Assche
7b011a5ee2
Fix scsi_cdb_read6()
...
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 >
2013-05-29 18:56:27 -07:00
Bart Van Assche
9dce01bbea
Fix PERSISTENT RESERVE IN / READ RESERVATION response unmarshalling
...
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 >
2013-05-29 18:56:00 -07:00
Bart Van Assche
0577fa9d66
Fix a buffer overflow in the code for unmarshalling the, PERSISTENT RESERVE IN / READ RESERVATION
...
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 >
2013-05-29 18:55:02 -07:00
Ronnie Sahlberg
99a74310a2
Block Device Characteristics: Add decode of the rest of this page that was missing
2013-05-27 08:28:26 -07:00
Ronnie Sahlberg
4e08d27031
Add tests from SANITIZE OVERWRITE parameter length
2013-05-26 15:21:43 -07:00
Ronnie Sahlberg
92b987de52
Add helpers for the SANITIZE service actions
2013-05-26 10:51:19 -07:00
Ronnie Sahlberg
eebd04e613
Add initial support for SANITIZE and a simple test to generate this opcode.
2013-05-25 16:02:02 -07:00
Ronnie Sahlberg
fcbeb2858f
REPORT_SUPPORTED_OPCODES, serviceaction is a 16 bit integer at offset 4, not a 32 bit integer
2013-05-19 09:47:45 -07:00
Ronnie Sahlberg
4df179bfd4
TESTS: Add checks for CDB sanity to REPORT SUPPORTED OPCODES
...
Read all individual opcodes and check that CDB length > 0 and that
CDB[0] Usage Data is 0xFF
2013-05-19 08:18:09 -07:00
Ronnie Sahlberg
709410b1d7
TESTS: Add some REPORT SUPPORTED OPCODES tests
...
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
2013-05-18 13:56:02 -07:00
Ronnie Sahlberg
ce4623b2fb
READ SUPPORTED OPCODES. Update the signature to allow setting all of the
...
parameters to this command.
2013-05-18 12:34:03 -07:00
Ronnie Sahlberg
704e0f6448
SCSI: add a safe function to read a byte from the datain buffer and use it
...
throughout the unmarshalling code
2013-05-12 13:57:15 -07:00
Ronnie Sahlberg
772d220217
Add a version descriptor
2013-05-11 16:03:23 -07:00
Paolo Bonzini
bcb2950d8d
use libgcrypt for MD5
...
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 >
2013-05-03 12:51:15 +02:00
Paolo Bonzini
cc742279d0
fix bug in md5 code
2013-05-03 12:50:58 +02:00
Ronnie Sahlberg
b7dd6b533b
TEST: Add a test that is cmdsn is too low the target just ignores the pdu
2013-04-30 19:05:23 -07:00
Ronnie Sahlberg
4a8d967541
Add support for synchronous command timeout.
...
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.
2013-04-29 20:42:33 -07:00
Ronnie Sahlberg
d280ce8ad7
Create safe 16/32/64 bit accessors for reading from the datain buffer
...
and use it throughout the scsi lowlevel file.
We probably want a safe accessor for byte access to at some stage.
2013-04-22 22:11:53 -07:00
Ronnie Sahlberg
322be0cf24
add missing version descriptor
2013-04-22 18:34:02 -07:00
Ronnie Sahlberg
555906e76e
Revert "Add SSC to the version descriptors."
...
This reverts commit 45f5fc2105 .
Conflicts:
include/scsi-lowlevel.h
2013-04-22 18:32:09 -07:00
Ronnie Sahlberg
e640fa3cde
missing , broke compile
2013-04-22 18:28:20 -07:00
Ronnie Sahlberg
45f5fc2105
Add SSC to the version descriptors.
...
I actually have a usb-stick that claims it supports SSC. I stongly doubt it.
2013-04-22 17:44:13 -07:00
Ronnie Sahlberg
91a98d6b92
Add handling of inquiry version descriptors
2013-04-21 14:04:30 -07:00
Ronnie Sahlberg
402653b9f3
portability updates
...
add check if ipv6/sockaddr_in6 is availavble or not
add check for poll.h and only include when available
add includes for AROS
2013-04-18 19:43:36 -07:00
Ronnie Sahlberg
fbf58ead9f
TESTS: When task management functions fail, print the reason why it failed.
2013-03-27 17:25:47 -07:00
Ronnie Sahlberg
aac7ed29b8
SYNC Task mgmt functions. Return !0 status if the command completed successfully
...
but the target responded with non-zero response code.
2013-03-26 17:38:47 -07:00
Ronnie Sahlberg
d5c5fb83af
We should still be able to login even if the device is reserved.
...
TESTUNITREADY returning reservation conflict is no reason to fail the login
2013-03-21 19:26:55 -07:00
Ronnie Sahlberg
f8901ea18e
Merge pull request #61 from plieven/ascq
...
Add ASCQ codes related to thin-provisioning
2013-03-11 06:46:20 -07:00
Peter Lieven
80ef1807ef
Add ASCQ codes related to thin-provisioning
...
Signed-off-by: Peter Lieven <pl@kamp.de >
2013-03-11 12:13:42 +01:00