summaryrefslogtreecommitdiffstats
path: root/src/server/iscsi.h
diff options
context:
space:
mode:
authorSimon Rettberg2025-11-12 14:41:52 +0100
committerSimon Rettberg2025-12-09 15:33:21 +0100
commit518c2855d51c4c2e79ff32a25d7efd78abf57cf8 (patch)
treef3febf86880f9f80a3193d6eeac5b984a3055480 /src/server/iscsi.h
parent[SERVER] iscsi: fix typo (diff)
downloaddnbd3-518c2855d51c4c2e79ff32a25d7efd78abf57cf8.tar.gz
dnbd3-518c2855d51c4c2e79ff32a25d7efd78abf57cf8.tar.xz
dnbd3-518c2855d51c4c2e79ff32a25d7efd78abf57cf8.zip
[SERVER] iscsi: Fix handling of reason_code in logout request
Only the lower 7 bits carry the reason code, mask away highest bit.
Diffstat (limited to 'src/server/iscsi.h')
-rw-r--r--src/server/iscsi.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/server/iscsi.h b/src/server/iscsi.h
index 53c4b0e..8c5831c 100644
--- a/src/server/iscsi.h
+++ b/src/server/iscsi.h
@@ -4105,6 +4105,8 @@ typedef struct __attribute__((packed)) iscsi_login_response_packet {
/// Logout request reason code: Remove the connection for recovery. The connection is closed, and all commands associated with it, if any, are to be prepared for a new allegiance.
#define ISCSI_LOGOUT_REQ_REASON_CODE_REMOVE_CONNECTION_RECOVERY 0x02
+/// Mask to get the logout reason from the reason_code field (lower 7 bits)
+#define ISCSI_LOGOUT_REQ_REASON_CODE_MASK 0x7f
/**
* @brief Logout request implicit reason code: Session reinstatement.
@@ -4236,7 +4238,7 @@ typedef struct __attribute__((packed)) iscsi_logout_req_packet {
* I_T_L nexus with the status of CHECK CONDITION, the ASC/ASCQ value
* of 0x47 / 0x7F ("SOME COMMANDS CLEARED BY ISCSI PROTOCOL EVENT"), etc.
*/
- int8_t reason_code;
+ uint8_t reason_code;
/// Reserved for future usage, always MUST be 0.
uint16_t reserved;