r11737: use _smb_setlen2() to allow for 24 bit lengths in SMB2 packets
authorAndrew Tridgell <tridge@samba.org>
Wed, 16 Nov 2005 06:36:08 +0000 (06:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:46:19 +0000 (13:46 -0500)
(This used to be commit 54fda24379ca1a20d6de2edf64dd79b3fe80a37d)

source4/include/smb_macros.h
source4/libcli/smb2/transport.c

index f1c62ab024cea60cc29403f275a1f8346edd5eb2..afe31e00bacab6d86d6bb1a2cd91e6eef329a53a 100644 (file)
@@ -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))
index c6fc890e34156dbc74f51e4ec2761e010190970d..083034a547585a9a4b764932aed4849ae2022f72 100644 (file)
@@ -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);