Which connection is actually used should not matter to the main logic.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
#define smbd_smb2_request_done(req, body, dyn) \
smbd_smb2_request_done_ex(req, NT_STATUS_OK, body, dyn, __location__)
-NTSTATUS smbd_smb2_send_oplock_break(struct smbXsrv_connection *xconn,
+NTSTATUS smbd_smb2_send_oplock_break(struct smbXsrv_client *client,
struct smbXsrv_open *op,
uint8_t oplock_level);
-NTSTATUS smbd_smb2_send_lease_break(struct smbXsrv_connection *xconn,
+NTSTATUS smbd_smb2_send_lease_break(struct smbXsrv_client *client,
uint16_t new_epoch,
uint32_t lease_flags,
struct smb2_lease_key *lease_key,
struct downgrade_lease_additional_state *state =
talloc_get_type_abort(private_data,
struct downgrade_lease_additional_state);
- struct smbXsrv_connection *xconn = state->client->connections;
NTSTATUS status;
- status = smbd_smb2_send_lease_break(xconn,
+ status = smbd_smb2_send_lease_break(state->client,
state->new_epoch,
state->break_flags,
&state->lease_key,
uint32_t break_from,
uint32_t break_to)
{
+ struct smbXsrv_client *client =
+ fsp->conn->sconn->client;
NTSTATUS status;
- struct smbXsrv_connection *xconn = NULL;
-
- /*
- * TODO: in future we should have a better algorithm
- * to find the correct connection for a break message.
- * Then we also need some retries if a channel gets disconnected.
- */
- xconn = fsp->conn->sconn->client->connections;
if (!NT_STATUS_IS_OK(fsp->op->status)) {
DBG_DEBUG("skip oplock break for file %s, %s, "
new_epoch = 0;
}
- status = smbd_smb2_send_lease_break(xconn, new_epoch, break_flags,
+ status = smbd_smb2_send_lease_break(client, new_epoch, break_flags,
&fsp->lease->lease.lease_key,
break_from, break_to);
} else {
uint8_t smb2_oplock_level;
smb2_oplock_level = (break_to & SMB2_LEASE_READ) ?
SMB2_OPLOCK_LEVEL_II : SMB2_OPLOCK_LEVEL_NONE;
- status = smbd_smb2_send_oplock_break(xconn,
+ status = smbd_smb2_send_oplock_break(client,
fsp->op,
smb2_oplock_level);
}
if (!NT_STATUS_IS_OK(status)) {
- smbd_server_connection_terminate(xconn,
- nt_errstr(status));
+ smbd_server_disconnect_client(client,
+ nt_errstr(status));
return;
}
}
return NT_STATUS_OK;
}
-NTSTATUS smbd_smb2_send_oplock_break(struct smbXsrv_connection *xconn,
+NTSTATUS smbd_smb2_send_oplock_break(struct smbXsrv_client *client,
struct smbXsrv_open *op,
uint8_t oplock_level)
{
+ struct smbXsrv_connection *xconn = client->connections;
uint8_t body[0x18];
SSVAL(body, 0x00, sizeof(body));
sizeof(body));
}
-NTSTATUS smbd_smb2_send_lease_break(struct smbXsrv_connection *xconn,
+NTSTATUS smbd_smb2_send_lease_break(struct smbXsrv_client *client,
uint16_t new_epoch,
uint32_t lease_flags,
struct smb2_lease_key *lease_key,
uint32_t current_lease_state,
uint32_t new_lease_state)
{
+ struct smbXsrv_connection *xconn = client->connections;
uint8_t body[0x2c];
SSVAL(body, 0x00, sizeof(body));