diff options
| author | Volker Lendecke <vl@samba.org> | 2014-07-07 09:35:40 +0000 |
|---|---|---|
| committer | Volker Lendecke <vl@samba.org> | 2014-07-08 17:28:11 +0200 |
| commit | 6fcc4f8aebdacdf12e1c5f2f112c6416720d12b3 (patch) | |
| tree | 27fe6ba607ffcb755eee5ae274117725fc4be130 | |
| parent | caa42ed385dc174d9529407d128424c37cff8e9c (diff) | |
| download | samba-6fcc4f8aebdacdf12e1c5f2f112c6416720d12b3.tar.gz samba-6fcc4f8aebdacdf12e1c5f2f112c6416720d12b3.tar.xz samba-6fcc4f8aebdacdf12e1c5f2f112c6416720d12b3.zip | |
smbd: Make nbt_hdr a field of its own in smbd_smb2_send_oplock_break
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
| -rw-r--r-- | source3/smbd/smb2_server.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 166fb6bcfc..e3444144f7 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -2723,7 +2723,8 @@ NTSTATUS smbd_smb2_request_error_ex(struct smbd_smb2_request *req, struct smbd_smb2_send_oplock_break_state { struct smbd_server_connection *sconn; struct smbd_smb2_send_queue queue_entry; - uint8_t buf[NBT_HDR_SIZE + SMB2_TF_HDR_SIZE + SMB2_HDR_BODY + 0x18]; + uint8_t nbt_hdr[NBT_HDR_SIZE]; + uint8_t buf[SMB2_TF_HDR_SIZE + SMB2_HDR_BODY + 0x18]; struct iovec vector[1+SMBD_SMB2_NUM_IOV_PER_REQ]; }; @@ -2757,7 +2758,7 @@ NTSTATUS smbd_smb2_send_oplock_break(struct smbd_server_connection *sconn, } state->sconn = sconn; - tf = state->buf + NBT_HDR_SIZE; + tf = state->buf; tf_len = SMB2_TF_HDR_SIZE; hdr = tf + tf_len; body = hdr + SMB2_HDR_BODY; @@ -2803,8 +2804,10 @@ NTSTATUS smbd_smb2_send_oplock_break(struct smbd_server_connection *sconn, SBVAL(body, 0x08, op->global->open_persistent_id); SBVAL(body, 0x10, op->global->open_volatile_id); - state->vector[0].iov_base = (void *)state->buf; - state->vector[0].iov_len = NBT_HDR_SIZE; + state->vector[0] = (struct iovec) { + .iov_base = state->nbt_hdr, + .iov_len = sizeof(state->nbt_hdr) + }; if (do_encryption) { state->vector[1+SMBD_SMB2_TF_IOV_OFS].iov_base = tf; |
