diff options
| author | Sebastian Vater | 2025-11-03 09:13:25 +0100 |
|---|---|---|
| committer | Sebastian Vater | 2025-11-03 09:13:25 +0100 |
| commit | bd4c5edf57c16ae7192bb5bca31562734513311f (patch) | |
| tree | e2f813ecf839c8c5e4e1f8afe16a43a51d8414e9 | |
| parent | More fixes to documentation for iSCSI rootfs with dracut in README.md. (diff) | |
| download | dnbd3-iscsi.tar.gz dnbd3-iscsi.tar.xz dnbd3-iscsi.zip | |
Fixed iSCSI SCSI CDB SERVICE_IN_ACTION_16 endianess conversion error. Finally, added no-strict-aliasing to compiler options.iscsi
| -rw-r--r-- | CMakeLists.txt | 4 | ||||
| -rw-r--r-- | src/server/iscsi.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e473fd..35aef20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,6 +112,10 @@ set(CMAKE_C_FLAGS_RELEASE "-Wno-error") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g -Og -DDEBUG") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -DNDEBUG") +# set no strict aliasing +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-strict-aliasing") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-strict-aliasing") + if(DNBD3_RELEASE_HARDEN AND CMAKE_BUILD_TYPE MATCHES "Release") # harden builds with specific C flags set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D_FORTIFY_SOURCE=2 -fstack-protector-all -fstack-clash-protection") diff --git a/src/server/iscsi.c b/src/server/iscsi.c index 835e273..7c04ab6 100644 --- a/src/server/iscsi.c +++ b/src/server/iscsi.c @@ -6102,7 +6102,7 @@ static int iscsi_scsi_emu_block_process(iscsi_scsi_task *scsi_task) buf->reserved[0] = 0ULL; buf->reserved[1] = 0ULL; - uint len = cdb_servce_in_action_16->alloc_len; + uint len = iscsi_get_be32(cdb_servce_in_action_16->alloc_len); if ( len > sizeof(struct iscsi_scsi_service_action_in_16_parameter_data_packet) ) len = sizeof(struct iscsi_scsi_service_action_in_16_parameter_data_packet); // TODO: Check whether scatter data is required |
