Skip to content

Commit

Permalink
digest_chk logic fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertvanheusden committed Oct 10, 2024
1 parent 17b07b7 commit 79a0ef6
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,8 @@ std::tuple<iscsi_pdu_bhs *, bool, uint64_t> server::receive_pdu(com_client *cons
else {
// verify digest
if (remote_header_digest != incoming_crc32c.first && digest_chk) {
if (digest_chk) {
ok = false;
pdu_error = true;
}
ok = false;
pdu_error = true;
DOLOG(logging::ll_info, "server::receive_pdu", cc->get_endpoint_name(), "header digest mismatch: received=%08x, calculated=%08x", remote_header_digest, incoming_crc32c.first);
}

Expand Down Expand Up @@ -228,11 +226,9 @@ std::tuple<iscsi_pdu_bhs *, bool, uint64_t> server::receive_pdu(com_client *cons
}
else {
// verify digest
if (remote_data_digest != incoming_crc32c.first) {
if (digest_chk) {
ok = false;
pdu_error = true;
}
if (remote_data_digest != incoming_crc32c.first && digest_chk) {
ok = false;
pdu_error = true;
DOLOG(logging::ll_info, "server::receive_pdu", cc->get_endpoint_name(), "data digest mismatch: received=%08x, calculated=%08x", remote_data_digest, incoming_crc32c.first);
}

Expand Down

0 comments on commit 79a0ef6

Please sign in to comment.