summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/include/smb_macros.h2
-rw-r--r--source4/libcli/smb2/transport.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/source4/include/smb_macros.h b/source4/include/smb_macros.h
index f1c62ab024..afe31e00ba 100644
--- a/source4/include/smb_macros.h
+++ b/source4/include/smb_macros.h
@@ -47,6 +47,8 @@
#define smb_len(buf) (PVAL(buf,3)|(PVAL(buf,2)<<8)|(PVAL(buf,1)<<16))
#define _smb_setlen(buf,len) do {(buf)[0] = 0; (buf)[1] = ((len)&0x10000)>>16; \
(buf)[2] = ((len)&0xFF00)>>8; (buf)[3] = (len)&0xFF;} while (0)
+#define _smb_setlen2(buf,len) do {(buf)[0] = 0; (buf)[1] = ((len)&0xFF0000)>>16; \
+ (buf)[2] = ((len)&0xFF00)>>8; (buf)[3] = (len)&0xFF;} while (0)
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
diff --git a/source4/libcli/smb2/transport.c b/source4/libcli/smb2/transport.c
index c6fc890e34..083034a547 100644
--- a/source4/libcli/smb2/transport.c
+++ b/source4/libcli/smb2/transport.c
@@ -251,7 +251,7 @@ void smb2_transport_send(struct smb2_request *req)
DATA_BLOB blob;
NTSTATUS status;
- _smb_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE);
+ _smb_setlen2(req->out.buffer, req->out.size - NBT_HDR_SIZE);
DEBUG(2, ("SMB2 send seqnum=0x%llx\n", req->seqnum));
dump_data(5, req->out.body, req->out.body_size);