summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-07 12:31:36 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-07 18:32:45 +0200
commitd609bb9b4201f50322278e949fe036fe70c1e77f (patch)
treea70d0562d75aac6e4448d0f5082f189822d0c628
parentefaea8e0e1ca389ac7bd82f2d9a3401f92094fe4 (diff)
downloadsamba-d609bb9b4201f50322278e949fe036fe70c1e77f.tar.gz
samba-d609bb9b4201f50322278e949fe036fe70c1e77f.tar.bz2
samba-d609bb9b4201f50322278e949fe036fe70c1e77f.zip
s3:smb2_server: make use of helper macros in smb2_calculate_credits()
metze
-rw-r--r--source3/smbd/smb2_server.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 2b32407aad..dd13bebbb8 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -802,10 +802,12 @@ static void smb2_calculate_credits(const struct smbd_smb2_request *inreq,
count = outreq->out.vector_count;
for (idx=1; idx < count; idx += SMBD_SMB2_NUM_IOV_PER_REQ) {
- uint8_t *outhdr = (uint8_t *)outreq->out.vector[idx].iov_base;
- smb2_set_operation_credit(outreq->sconn,
- &inreq->in.vector[idx],
- &outreq->out.vector[idx]);
+ struct iovec *inhdr_v = SMBD_SMB2_IDX_HDR_IOV(inreq,in,idx);
+ struct iovec *outhdr_v = SMBD_SMB2_IDX_HDR_IOV(outreq,out,idx);
+ uint8_t *outhdr = (uint8_t *)outhdr_v->iov_base;
+
+ smb2_set_operation_credit(outreq->sconn, inhdr_v, outhdr_v);
+
/* To match Windows, count up what we
just granted. */
total_credits += SVAL(outhdr, SMB2_HDR_CREDIT);