svn commit: samba r11737 - in branches/SAMBA_4_0/source: include libcli/smb2

tridge at samba.org tridge at samba.org
Wed Nov 16 06:36:08 GMT 2005


Author: tridge
Date: 2005-11-16 06:36:08 +0000 (Wed, 16 Nov 2005)
New Revision: 11737

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11737

Log:

use _smb_setlen2() to allow for 24 bit lengths in SMB2 packets



Modified:
   branches/SAMBA_4_0/source/include/smb_macros.h
   branches/SAMBA_4_0/source/libcli/smb2/transport.c


Changeset:
Modified: branches/SAMBA_4_0/source/include/smb_macros.h
===================================================================
--- branches/SAMBA_4_0/source/include/smb_macros.h	2005-11-16 04:35:49 UTC (rev 11736)
+++ branches/SAMBA_4_0/source/include/smb_macros.h	2005-11-16 06:36:08 UTC (rev 11737)
@@ -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))

Modified: branches/SAMBA_4_0/source/libcli/smb2/transport.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/smb2/transport.c	2005-11-16 04:35:49 UTC (rev 11736)
+++ branches/SAMBA_4_0/source/libcli/smb2/transport.c	2005-11-16 06:36:08 UTC (rev 11737)
@@ -251,7 +251,7 @@
 	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);



More information about the samba-cvs mailing list