const char *smb2_opcode_name(uint16_t opcode)
{
- if (opcode >= ARRAY_SIZE(smbd_smb2_table)) {
+ if (unlikely(opcode >= ARRAY_SIZE(smbd_smb2_table))) {
return "Bad SMB2 opcode";
}
return smbd_smb2_table[opcode].name;
{
const struct smbd_smb2_dispatch_table *ret = NULL;
- if (opcode >= ARRAY_SIZE(smbd_smb2_table)) {
+ if (unlikely(opcode >= ARRAY_SIZE(smbd_smb2_table))) {
return NULL;
}
bool smbd_is_smb2_header(const uint8_t *inbuf, size_t size)
{
- if (size < (4 + SMB2_HDR_BODY)) {
+ if (unlikely(size < (4 + SMB2_HDR_BODY))) {
return false;
}
- if (IVAL(inbuf, 4) != SMB2_MAGIC) {
+ if (unlikely(IVAL(inbuf, 4) != SMB2_MAGIC)) {
return false;
}
sconn->smb2.max_credits = lp_smb2_max_credits();
sconn->smb2.credits_bitmap = bitmap_talloc(sconn,
sconn->smb2.max_credits);
- if (sconn->smb2.credits_bitmap == NULL) {
+ if (unlikely(sconn->smb2.credits_bitmap == NULL)) {
return NT_STATUS_NO_MEMORY;
}
TEVENT_FD_READ,
smbd_smb2_connection_handler,
sconn);
- if (sconn->smb2.fde == NULL) {
+ if (unlikely(sconn->smb2.fde == NULL)) {
return NT_STATUS_NO_MEMORY;
}
#if 0
/* Enable this to find subtle valgrind errors. */
mem_pool = talloc_init("smbd_smb2_request_allocate");
-#else
- mem_pool = talloc_tos();
-#endif
if (mem_pool == NULL) {
return NULL;
}
+#else
+ mem_pool = talloc_tos();
+#endif
req = talloc_zero(mem_pool, struct smbd_smb2_request);
- if (req == NULL) {
+ if (unlikely(req == NULL)) {
talloc_free(mem_pool);
return NULL;
}
tf_len = 0;
}
- if (len < 4) {
+ if (unlikely(len < 4)) {
DEBUG(10, ("%d bytes left, expected at least %d\n",
(int)len, 4));
goto inval;
}
- if (IVAL(hdr, 0) == SMB2_TF_MAGIC) {
+ if (unlikely(IVAL(hdr, 0) == SMB2_TF_MAGIC)) {
struct smbXsrv_session *s = NULL;
uint64_t uid;
struct iovec tf_iov[2];
NTSTATUS status;
size_t enc_len;
- if (conn->protocol < PROTOCOL_SMB2_24) {
+ if (unlikely(conn->protocol < PROTOCOL_SMB2_24)) {
DEBUG(10, ("Got SMB2_TRANSFORM header, "
"but dialect[0x%04X] is used\n",
conn->smb2.server.dialect));
goto inval;
}
- if (len < SMB2_TF_HDR_SIZE) {
+ if (unlikely(len < SMB2_TF_HDR_SIZE)) {
DEBUG(1, ("%d bytes left, expected at least %d\n",
(int)len, SMB2_TF_HDR_SIZE));
goto inval;
enc_len = IVAL(tf, SMB2_TF_MSG_SIZE);
uid = BVAL(tf, SMB2_TF_SESSION_ID);
- if (len < SMB2_TF_HDR_SIZE + enc_len) {
+ if (unlikely(len < SMB2_TF_HDR_SIZE + enc_len)) {
DEBUG(1, ("%d bytes left, expected at least %d\n",
(int)len,
(int)(SMB2_TF_HDR_SIZE + enc_len)));
}
status = smb2srv_session_lookup(conn, uid, now, &s);
- if (s == NULL) {
+ if (unlikely(s == NULL)) {
DEBUG(1, ("invalid session[%llu] in "
"SMB2_TRANSFORM header\n",
(unsigned long long)uid));
status = smb2_signing_decrypt_pdu(s->global->decryption_key,
conn->protocol,
tf_iov, 2);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
TALLOC_FREE(iov);
return status;
}
* We need the header plus the body length field
*/
- if (len < SMB2_HDR_BODY + 2) {
+ if (unlikely(len < SMB2_HDR_BODY + 2)) {
DEBUG(10, ("%d bytes left, expected at least %d\n",
(int)len, SMB2_HDR_BODY));
goto inval;
}
- if (IVAL(hdr, 0) != SMB2_MAGIC) {
+ if (unlikely(IVAL(hdr, 0) != SMB2_MAGIC)) {
DEBUG(10, ("Got non-SMB2 PDU: %x\n",
IVAL(hdr, 0)));
goto inval;
}
- if (SVAL(hdr, 4) != SMB2_HDR_BODY) {
+ if (unlikely(SVAL(hdr, 4) != SMB2_HDR_BODY)) {
DEBUG(10, ("Got HDR len %d, expected %d\n",
SVAL(hdr, 4), SMB2_HDR_BODY));
goto inval;
body_size = SVAL(hdr, SMB2_HDR_BODY);
if (next_command_ofs != 0) {
- if (next_command_ofs < (SMB2_HDR_BODY + 2)) {
+ if (unlikely(next_command_ofs < (SMB2_HDR_BODY + 2))) {
goto inval;
}
- if (next_command_ofs > full_size) {
+ if (unlikely(next_command_ofs > full_size)) {
goto inval;
}
full_size = next_command_ofs;
}
- if (body_size < 2) {
+ if (unlikely(body_size < 2)) {
goto inval;
}
body_size &= 0xfffe;
- if (body_size > (full_size - SMB2_HDR_BODY)) {
+ if (unlikely(body_size > (full_size - SMB2_HDR_BODY))) {
/*
* let the caller handle the error
*/
struct iovec,
num_iov +
SMBD_SMB2_NUM_IOV_PER_REQ);
- if (iov_tmp == NULL) {
+ if (unlikely(iov_tmp == NULL)) {
TALLOC_FREE(iov_alloc);
return NT_STATUS_NO_MEMORY;
}
NTSTATUS status;
NTTIME now;
- if (size < (4 + SMB2_HDR_BODY + 2)) {
+ if (unlikely(size < (4 + SMB2_HDR_BODY + 2))) {
DEBUG(0,("Invalid SMB2 packet length count %ld\n", (long)size));
return NT_STATUS_INVALID_PARAMETER;
}
inhdr = inbuf + 4;
protocol_version = IVAL(inhdr, SMB2_HDR_PROTOCOL_ID);
- if (protocol_version != SMB2_MAGIC) {
+ if (unlikely(protocol_version != SMB2_MAGIC)) {
DEBUG(0,("Invalid SMB packet: protocol prefix: 0x%08X\n",
protocol_version));
return NT_STATUS_INVALID_PARAMETER;
}
cmd = SVAL(inhdr, SMB2_HDR_OPCODE);
- if (cmd != SMB2_OP_NEGPROT) {
+ if (unlikely(cmd != SMB2_OP_NEGPROT)) {
DEBUG(0,("Invalid SMB packet: first request: 0x%04X\n",
cmd));
return NT_STATUS_INVALID_PARAMETER;
}
next_command_ofs = IVAL(inhdr, SMB2_HDR_NEXT_COMMAND);
- if (next_command_ofs != 0) {
+ if (unlikely(next_command_ofs != 0)) {
DEBUG(0,("Invalid SMB packet: next_command: 0x%08X\n",
next_command_ofs));
return NT_STATUS_INVALID_PARAMETER;
}
req = smbd_smb2_request_allocate(sconn);
- if (req == NULL) {
+ if (unlikely(req == NULL)) {
return NT_STATUS_NO_MEMORY;
}
req->sconn = sconn;
size - NBT_HDR_SIZE,
req, &req->in.vector,
&req->in.vector_count);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
TALLOC_FREE(req);
return status;
}
struct bitmap *credits_bm = sconn->smb2.credits_bitmap;
unsigned int offset;
- if (seq_id < sconn->smb2.seqnum_low) {
+ if (unlikely(seq_id < sconn->smb2.seqnum_low)) {
DEBUG(0,("smb2_validate_sequence_number: bad message_id "
"%llu (sequence id %llu) "
"(granted = %u, low = %llu, range = %u)\n",
return false;
}
- if (seq_id >= sconn->smb2.seqnum_low + sconn->smb2.seqnum_range) {
+ if (unlikely(seq_id >= sconn->smb2.seqnum_low + sconn->smb2.seqnum_range)) {
DEBUG(0,("smb2_validate_sequence_number: bad message_id "
"%llu (sequence id %llu) "
"(granted = %u, low = %llu, range = %u)\n",
offset = seq_id % sconn->smb2.max_credits;
- if (bitmap_query(credits_bm, offset)) {
+ if (unlikely(bitmap_query(credits_bm, offset))) {
DEBUG(0,("smb2_validate_sequence_number: duplicate message_id "
"%llu (sequence id %llu) "
"(granted = %u, low = %llu, range = %u) "
uint16_t credit_charge = 1;
uint64_t i;
- if (opcode == SMB2_OP_CANCEL) {
+ if (unlikely(opcode == SMB2_OP_CANCEL)) {
/* SMB2_CANCEL requests by definition resend messageids. */
return true;
}
(unsigned long long) sconn->smb2.seqnum_low,
(unsigned long long) sconn->smb2.seqnum_range));
- if (sconn->smb2.credits_granted < credit_charge) {
+ if (unlikely(sconn->smb2.credits_granted < credit_charge)) {
DEBUG(0, ("smb2_validate_message_id: client used more "
"credits than granted, mid %llu, charge %llu, "
"credits_granted %llu, "
(unsigned long long)id));
ok = smb2_validate_sequence_number(sconn, message_id, id);
- if (!ok) {
+ if (unlikely(!ok)) {
return false;
}
}
count = req->in.vector_count;
- if (count < 1 + SMBD_SMB2_NUM_IOV_PER_REQ) {
+ if (unlikely(count < 1 + SMBD_SMB2_NUM_IOV_PER_REQ)) {
/* It's not a SMB2 request */
return NT_STATUS_INVALID_PARAMETER;
}
struct iovec *hdr = SMBD_SMB2_IDX_HDR_IOV(req,in,idx);
struct iovec *body = SMBD_SMB2_IDX_BODY_IOV(req,in,idx);
const uint8_t *inhdr = NULL;
+ bool ok;
- if (hdr->iov_len != SMB2_HDR_BODY) {
+ if (unlikely(hdr->iov_len != SMB2_HDR_BODY)) {
return NT_STATUS_INVALID_PARAMETER;
}
- if (body->iov_len < 2) {
+ if (unlikely(body->iov_len < 2)) {
return NT_STATUS_INVALID_PARAMETER;
}
inhdr = (const uint8_t *)hdr->iov_base;
/* Check the SMB2 header */
- if (IVAL(inhdr, SMB2_HDR_PROTOCOL_ID) != SMB2_MAGIC) {
+ if (unlikely(IVAL(inhdr, SMB2_HDR_PROTOCOL_ID) != SMB2_MAGIC)) {
return NT_STATUS_INVALID_PARAMETER;
}
- if (!smb2_validate_message_id(req->sconn, inhdr)) {
+ ok = smb2_validate_message_id(req->sconn, inhdr);
+ if (unlikely(!ok)) {
return NT_STATUS_INVALID_PARAMETER;
}
}
SMB_ASSERT(sconn->smb2.max_credits >= sconn->smb2.credits_granted);
- if (sconn->smb2.max_credits < credit_charge) {
+ if (unlikely(sconn->smb2.max_credits < credit_charge)) {
smbd_server_connection_terminate(sconn,
"client error: credit charge > max credits\n");
return;
vector = req->out._vector;
} else {
vector = talloc_zero_array(req, struct iovec, count);
- if (vector == NULL) {
+ if (unlikely(vector == NULL)) {
return NT_STATUS_NO_MEMORY;
}
mem_ctx = vector;
/* Calculate outgoing credits */
smb2_calculate_credits(req, nreq);
- if (DEBUGLEVEL >= 10) {
+ if (unlikely(DEBUGLEVEL >= 10)) {
dbgtext("smb2_send_async_interim_response: nreq->current_idx = %u\n",
(unsigned int)nreq->current_idx );
dbgtext("smb2_send_async_interim_response: returning %u vectors\n",
nreq->sconn->smb2.send_queue_len++;
status = smbd_smb2_io_handler(sconn, TEVENT_FD_WRITE);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
return status;
}
}
}
- if (DEBUGLEVEL >= 10) {
+ if (unlikely(DEBUGLEVEL >= 10)) {
dbgtext("smbd_smb2_request_pending_queue: req->current_idx = %u\n",
(unsigned int)req->current_idx );
print_req_vectors(req);
req, defer_endtime,
smbd_smb2_request_pending_timer,
req);
- if (req->async_te == NULL) {
+ if (unlikely(req->async_te == NULL)) {
return NT_STATUS_NO_MEMORY;
}
*/
state = talloc_zero(req->sconn, struct smbd_smb2_request_pending_state);
- if (state == NULL) {
+ if (unlikely(state == NULL)) {
smbd_server_connection_terminate(req->sconn,
nt_errstr(NT_STATUS_NO_MEMORY));
return;
sconn->smb2.send_queue_len++;
status = smbd_smb2_io_handler(sconn, TEVENT_FD_WRITE);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
smbd_server_connection_terminate(sconn,
nt_errstr(status));
return;
(unsigned long long) BVAL(inhdr, SMB2_HDR_MESSAGE_ID),
credit_charge, needed_charge));
- if (needed_charge > credit_charge) {
+ if (unlikely(needed_charge > credit_charge)) {
DEBUG(2, ("CreditCharge too low, given %d, needed %d\n",
credit_charge, needed_charge));
return NT_STATUS_INVALID_PARAMETER;
/*
* The following should be checked already.
*/
- if (req->in.vector_count < SMBD_SMB2_NUM_IOV_PER_REQ) {
+ if (unlikely(req->in.vector_count < SMBD_SMB2_NUM_IOV_PER_REQ)) {
return NT_STATUS_INTERNAL_ERROR;
}
- if (req->current_idx > max_idx) {
+ if (unlikely(req->current_idx > max_idx)) {
return NT_STATUS_INTERNAL_ERROR;
}
inhdr_v = SMBD_SMB2_IN_HDR_IOV(req);
- if (inhdr_v->iov_len != SMB2_HDR_BODY) {
+ if (unlikely(inhdr_v->iov_len != SMB2_HDR_BODY)) {
return NT_STATUS_INTERNAL_ERROR;
}
- if (SMBD_SMB2_IN_BODY_LEN(req) < 2) {
+ if (unlikely(SMBD_SMB2_IN_BODY_LEN(req) < 2)) {
return NT_STATUS_INTERNAL_ERROR;
}
break;
case SMB2_OP_WRITE:
if (req->smb1req != NULL && req->smb1req->unread_bytes > 0) {
- if (req->smb1req->unread_bytes < min_dyn_size) {
+ if (unlikely(req->smb1req->unread_bytes < min_dyn_size)) {
return NT_STATUS_INVALID_PARAMETER;
}
* where the last byte might be in the
* dynamic section..
*/
- if (SMBD_SMB2_IN_BODY_LEN(req) != (expected_body_size & 0xFFFFFFFE)) {
+ if (unlikely(SMBD_SMB2_IN_BODY_LEN(req) != (expected_body_size & 0xFFFFFFFE))) {
return NT_STATUS_INVALID_PARAMETER;
}
- if (SMBD_SMB2_IN_DYN_LEN(req) < min_dyn_size) {
+ if (unlikely(SMBD_SMB2_IN_DYN_LEN(req) < min_dyn_size)) {
return NT_STATUS_INVALID_PARAMETER;
}
inbody = SMBD_SMB2_IN_BODY_PTR(req);
body_size = SVAL(inbody, 0x00);
- if (body_size != expected_body_size) {
+ if (unlikely(body_size != expected_body_size)) {
return NT_STATUS_INVALID_PARAMETER;
}
* once the protocol is negotiated
* SMB2_OP_NEGPROT is not allowed anymore
*/
- if (opcode == SMB2_OP_NEGPROT) {
+ if (unlikely(opcode == SMB2_OP_NEGPROT)) {
/* drop the connection */
return NT_STATUS_INVALID_PARAMETER;
}
}
call = smbd_smb2_call(opcode);
- if (call == NULL) {
+ if (unlikely(call == NULL)) {
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}
allowed_flags = SMB2_HDR_FLAG_CHAINED |
SMB2_HDR_FLAG_SIGNED |
SMB2_HDR_FLAG_DFS;
- if (opcode == SMB2_OP_CANCEL) {
+ if (unlikely(opcode == SMB2_OP_CANCEL)) {
allowed_flags |= SMB2_HDR_FLAG_ASYNC;
}
- if ((flags & ~allowed_flags) != 0) {
+ if (unlikely((flags & ~allowed_flags) != 0)) {
return smbd_smb2_request_error(req, NT_STATUS_INVALID_PARAMETER);
}
if (!NT_STATUS_IS_OK(session_status)) {
return smbd_smb2_request_error(req, session_status);
}
- } else if (opcode == SMB2_OP_CANCEL) {
+ } else if (unlikely(opcode == SMB2_OP_CANCEL)) {
/* Cancel requests are allowed to skip the signing */
} else if (signing_required) {
/*
* calls change_to_user() on success.
*/
status = smbd_smb2_request_check_tcon(req);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
return smbd_smb2_request_error(req, status);
}
if (req->tcon->global->encryption_required) {
SMB_ASSERT(call->need_tcon);
- if (needed > body_size) {
+ if (unlikely(needed > body_size)) {
return smbd_smb2_request_error(req,
NT_STATUS_INVALID_PARAMETER);
}
file_id_volatile = BVAL(body, call->fileid_ofs + 8);
fsp = file_fsp_smb2(req, file_id_persistent, file_id_volatile);
- if (fsp == NULL) {
+ if (unlikely(fsp == NULL)) {
if (!call->allow_invalid_fileid) {
return smbd_smb2_request_error(req,
NT_STATUS_FILE_CLOSED);
* yet.
*/
struct tevent_immediate *im = tevent_create_immediate(req);
- if (!im) {
+ if (unlikely(!im)) {
return NT_STATUS_NO_MEMORY;
}
req->sconn->smb2.send_queue_len++;
status = smbd_smb2_io_handler(sconn, TEVENT_FD_WRITE);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
return status;
}
TALLOC_FREE(im);
- if (DEBUGLEVEL >= 10) {
+ if (unlikely(DEBUGLEVEL >= 10)) {
DEBUG(10,("smbd_smb2_request_dispatch_immediate: idx[%d] of %d vectors\n",
req->current_idx, req->in.vector_count));
print_req_vectors(req);
}
status = smbd_smb2_request_dispatch(req);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
}
status = smbd_smb2_request_next_incoming(sconn);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
}
(unsigned int)(dyn ? dyn->length : 0),
location));
- if (body.length < 2) {
+ if (unlikely(body.length < 2)) {
return smbd_smb2_request_error(req, NT_STATUS_INTERNAL_ERROR);
}
- if ((body.length % 2) != 0) {
+ if (unlikely((body.length % 2) != 0)) {
return smbd_smb2_request_error(req, NT_STATUS_INTERNAL_ERROR);
}
new_size = old_size + pad_size;
new_dyn = talloc_zero_array(req,
uint8_t, new_size);
- if (new_dyn == NULL) {
+ if (unlikely(new_dyn == NULL)) {
return smbd_smb2_request_error(req,
NT_STATUS_NO_MEMORY);
}
req->current_idx, nt_errstr(status), info ? " +info" : "",
location));
- if (unread_bytes) {
+ if (unlikely(unread_bytes)) {
/* Recvfile error. Drain incoming socket. */
size_t ret;
}
state = talloc_zero(sconn, struct smbd_smb2_send_oplock_break_state);
- if (state == NULL) {
+ if (unlikely(state == NULL)) {
return NT_STATUS_NO_MEMORY;
}
state->sconn = sconn;
state->sconn->smb2.send_queue_len++;
status = smbd_smb2_io_handler(sconn, TEVENT_FD_WRITE);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
return status;
}
/* ask for the next request */
ZERO_STRUCTP(state);
state->req = smbd_smb2_request_allocate(sconn);
- if (state->req == NULL) {
+ if (unlikely(state->req == NULL)) {
return NT_STATUS_NO_MEMORY;
}
state->req->sconn = sconn;
(unsigned int)size));
status = smbd_initialize_smb2(sconn);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
}
status = smbd_smb2_request_create(sconn, inbuf, size, &req);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
}
status = smbd_smb2_request_validate(req);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
}
status = smbd_smb2_request_setup_out(req);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
}
status = smbd_smb2_request_dispatch(req);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
}
status = smbd_smb2_request_next_incoming(sconn);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
}
state->pktbuf,
uint8_t,
state->pktfull);
- if (state->pktbuf == NULL) {
+ if (unlikely(state->pktbuf == NULL)) {
return NT_STATUS_NO_MEMORY;
}
* Now we analyze the NBT header
*/
state->pktfull = smb2_len(state->hdr.nbt);
- if (state->pktfull == 0) {
+ if (unlikely(state->pktfull == 0)) {
goto got_full;
}
}
state->pktbuf = talloc_array(state->req, uint8_t, state->pktlen);
- if (state->pktbuf == NULL) {
+ if (unlikely(state->pktbuf == NULL)) {
return NT_STATUS_NO_MEMORY;
}
got_full:
- if (state->hdr.nbt[0] != 0x00) {
+ if (unlikely(state->hdr.nbt[0] != 0x00)) {
DEBUG(1,("ignore NBT[0x%02X] msg\n",
state->hdr.nbt[0]));
req,
&req->in.vector,
&req->in.vector_count);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
return status;
}
if (state->doing_receivefile) {
req->smb1req = talloc_zero(req, struct smb_request);
- if (req->smb1req == NULL) {
+ if (unlikely(req->smb1req == NULL)) {
return NT_STATUS_NO_MEMORY;
}
req->smb1req->unread_bytes = state->pktfull - state->pktlen;
req->current_idx, req->in.vector_count));
status = smbd_smb2_request_validate(req);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
return status;
}
status = smbd_smb2_request_setup_out(req);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
return status;
}
status = smbd_smb2_request_dispatch(req);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
return status;
}
}
status = smbd_smb2_request_next_incoming(sconn);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
return status;
}
NTSTATUS status;
status = smbd_smb2_io_handler(sconn, flags);
- if (!NT_STATUS_IS_OK(status)) {
+ if (unlikely(!NT_STATUS_IS_OK(status))) {
smbd_server_connection_terminate(sconn, nt_errstr(status));
return;
}