r12725: some minor updates
authorStefan Metzmacher <metze@samba.org>
Thu, 5 Jan 2006 16:43:56 +0000 (16:43 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:49:45 +0000 (13:49 -0500)
metze

source/include/smb.h
source/libcli/raw/clitransport.c
source/libcli/smb2/transport.c
source/smb_server/smb2/receive.c

index 5297ef9e27a02d559da262aeede3c93dce4386de..78a66dd20a5b5d6e135d0a741095dee8223e6f22 100644 (file)
 #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; \
+#define _smb2_setlen(buf,len) do {(buf)[0] = 0; (buf)[1] = ((len)&0xFF0000)>>16; \
         (buf)[2] = ((len)&0xFF00)>>8; (buf)[3] = (len)&0xFF;} while (0)
 
 #endif /* _SMB_H */
index a0efe7042c9b26bf8433459ea621db43e3e385ab..df5c608d081496bf03c95ad052fa480abd21ebf1 100644 (file)
@@ -184,7 +184,7 @@ struct smbcli_request *smbcli_transport_connect_send(struct smbcli_transport *tr
        memcpy(p, calling_blob.data, calling_blob.length);
        p += calling_blob.length;
 
-       _smb_setlen(req->out.buffer, PTR_DIFF(p, req->out.buffer)-4);
+       _smb_setlen(req->out.buffer, PTR_DIFF(p, req->out.buffer) - NBT_HDR_SIZE);
        SCVAL(req->out.buffer,0,0x81);
 
        if (!smbcli_request_send(req)) {
index d5591fa11c5ea93b1245f68d30ee48f6fcc3fbb8..6567ad4de72d9729487d4c8be7f46a47d8874fcb 100644 (file)
@@ -272,7 +272,7 @@ void smb2_transport_send(struct smb2_request *req)
        DATA_BLOB blob;
        NTSTATUS status;
 
-       _smb_setlen2(req->out.buffer, req->out.size - NBT_HDR_SIZE);
+       _smb2_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE);
 
        DEBUG(2, ("SMB2 send seqnum=0x%llx\n", (long long)req->seqnum));
        dump_data(5, req->out.body, req->out.body_size);
index a1f12f84c075df7d21efa8081bdd471fb7309519..ef67d29c515883ce7c79420ff1d697b0423ae9f2 100644 (file)
@@ -87,7 +87,7 @@ void smb2srv_send_reply(struct smb2srv_request *req)
        NTSTATUS status;
 
        if (req->out.size > NBT_HDR_SIZE) {
-               _smb_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE);
+               _smb2_setlen(req->out.buffer, req->out.size - NBT_HDR_SIZE);
        }
 
        blob = data_blob_const(req->out.buffer, req->out.size);