unsigned num_reqs;
bool ok;
- ok = smb1_parse_chain(talloc_tos(), (uint8_t *)inbuf, sconn, encrypted,
+ ok = smb1_parse_chain(talloc_tos(), (uint8_t *)inbuf, xconn, encrypted,
seqnum, &reqs, &num_reqs);
if (!ok) {
char errbuf[smb_size];
}
bool smb1_parse_chain(TALLOC_CTX *mem_ctx, const uint8_t *buf,
- struct smbd_server_connection *sconn,
+ struct smbXsrv_connection *xconn,
bool encrypted, uint32_t seqnum,
struct smb_request ***reqs, unsigned *num_reqs)
{
- struct smbXsrv_connection *xconn = sconn->conn;
+ struct smbd_server_connection *sconn = NULL;
struct smb1_parse_chain_state state;
unsigned i;
+ if (xconn != NULL) {
+ sconn = xconn->sconn;
+ }
+
state.mem_ctx = mem_ctx;
state.buf = buf;
state.sconn = sconn;
void *private_data);
unsigned smb1_chain_length(const uint8_t *buf);
bool smb1_parse_chain(TALLOC_CTX *mem_ctx, const uint8_t *buf,
- struct smbd_server_connection *sconn,
+ struct smbXsrv_connection *xconn,
bool encrypted, uint32_t seqnum,
struct smb_request ***reqs, unsigned *num_reqs);
bool req_is_in_chain(const struct smb_request *req);
ret &= (chain_length == 0);
ret &= smb1_parse_chain(talloc_tos(), chain1_data,
- vfs->conn->sconn, false, 0,
+ NULL, false, 0,
&requests, &chain_length);
ret &= (chain_length == 3);
ret &= smb1_parse_chain(talloc_tos(), chain2_data,
- vfs->conn->sconn, false, 0,
+ NULL, false, 0,
&requests, &chain_length);
ret &= (chain_length == 2);