return (smb_size + num_words*2 + num_bytes);
}
-static bool valid_smb_header(struct smbd_server_connection *sconn,
- const uint8_t *inbuf)
+static bool valid_smb_header(const uint8_t *inbuf)
{
if (is_encrypted_packet(inbuf)) {
return true;
size_t pdulen = nread - NBT_HDR_SIZE;
smbd_smb2_first_negprot(xconn, inpdu, pdulen);
return;
- } else if (nread >= smb_size && valid_smb_header(sconn, inbuf)
+ } else if (nread >= smb_size && valid_smb_header(inbuf)
&& CVAL(inbuf, smb_com) != 0x72) {
/* This is a non-negprot SMB1 packet.
Disable SMB2 from now on. */
/* Make sure this is an SMB packet. smb_size contains NetBIOS header
* so subtract 4 from it. */
- if ((nread < (smb_size - 4)) || !valid_smb_header(sconn, inbuf)) {
+ if ((nread < (smb_size - 4)) || !valid_smb_header(inbuf)) {
DEBUG(2,("Non-SMB packet of length %d. Terminating server\n",
smb_len(inbuf)));
DEBUG(10, ("Got short packet: %d bytes\n", (int)inbuf_len));
return false;
}
- if (!valid_smb_header(state->sconn, inbuf)) {
+ if (!valid_smb_header(inbuf)) {
DEBUG(10, ("Got invalid SMB header\n"));
return false;
}