s4:libcli:smb2 Rename pending_id to async_id and make 64-bit
authorSteven Danneman <steven.danneman@isilon.com>
Wed, 22 Sep 2010 20:23:49 +0000 (13:23 -0700)
committerSteven Danneman <steven.danneman@isilon.com>
Thu, 23 Sep 2010 00:52:53 +0000 (17:52 -0700)
Match MS-SMB2 - 2.2.1.1   SMB2 Packet Header - ASYNC

libcli/smb/smb2_constants.h
source4/libcli/smb2/cancel.c
source4/libcli/smb2/smb2.h
source4/libcli/smb2/transport.c
source4/torture/smb2/util.c

index a3885f9b7dcd9c7819df7ad330c5b6aae16bdd83..6d29d6e9ea175ab0e59a29794710e23d3230a561 100644 (file)
@@ -28,7 +28,7 @@
 #define SMB2_HDR_EPOCH         0x06
 #define SMB2_HDR_STATUS                0x08
 #define SMB2_HDR_OPCODE                0x0c
-#define SMB2_HDR_CREDIT        0x0e
+#define SMB2_HDR_CREDIT                0x0e
 #define SMB2_HDR_FLAGS         0x10
 #define SMB2_HDR_NEXT_COMMAND  0x14
 #define SMB2_HDR_MESSAGE_ID     0x18
@@ -38,6 +38,9 @@
 #define SMB2_HDR_SIGNATURE     0x30 /* 16 bytes */
 #define SMB2_HDR_BODY          0x40
 
+/* offsets into header elements for an async SMB2 request */
+#define SMB2_HDR_ASYNC_ID      0x20
+
 /* header flags */
 #define SMB2_HDR_FLAG_REDIRECT  0x01
 #define SMB2_HDR_FLAG_ASYNC     0x02
index 65f02187c1b01455e2b78eed724621a6b765acd6..28ef3099f3028a201b8e85ab7803f48d97b33162 100644 (file)
@@ -53,7 +53,7 @@ NTSTATUS smb2_cancel(struct smb2_request *r)
 
        SIVAL(c->out.hdr, SMB2_HDR_FLAGS,       0x00000002);
        SSVAL(c->out.hdr, SMB2_HDR_CREDIT,      0x0030);
-       SIVAL(c->out.hdr, SMB2_HDR_PID,         r->cancel.pending_id);
+       SBVAL(c->out.hdr, SMB2_HDR_ASYNC_ID,    r->cancel.async_id);
        SBVAL(c->out.hdr, SMB2_HDR_MESSAGE_ID,  c->seqnum);
        if (r->session) {
                SBVAL(c->out.hdr, SMB2_HDR_SESSION_ID,  r->session->uid);
index 26b9bcb2a10cc16f81c1992f4986a5f8a2c19b3a..aaafedd28f00d50a387822f68009d200c3f82367 100644 (file)
@@ -167,7 +167,7 @@ struct smb2_request {
 
        /* each request is in one of 3 possible states */
        enum smb2_request_state state;
-       
+
        struct smb2_transport *transport;
        struct smb2_session   *session;
        struct smb2_tree      *tree;
@@ -177,13 +177,13 @@ struct smb2_request {
        struct {
                bool do_cancel;
                bool can_cancel;
-               uint32_t pending_id;
+               uint64_t async_id;
        } cancel;
 
        /* the NT status for this request. Set by packet receive code
           or code detecting error. */
        NTSTATUS status;
-       
+
        struct smb2_request_buffer in;
        struct smb2_request_buffer out;
 
index dffd1acd2b503ec5a0d85ea091909618ba70f759..04b2d383279fc726c7c6f41ae6beb08edc379cd3 100644 (file)
@@ -302,7 +302,7 @@ static NTSTATUS smb2_transport_finish_recv(void *private_data, DATA_BLOB blob)
        if ((flags & SMB2_HDR_FLAG_ASYNC) &&
            NT_STATUS_EQUAL(req->status, STATUS_PENDING)) {
                req->cancel.can_cancel = true;
-               req->cancel.pending_id = IVAL(hdr, SMB2_HDR_PID);
+               req->cancel.async_id = BVAL(hdr, SMB2_HDR_ASYNC_ID);
                for (i=0; i< req->cancel.do_cancel; i++) {
                        smb2_cancel(req);
                }
index 96981125c2fa8214f534fb071d084a852dc20212..8feb96857d1b13f5c4ab3d818e5eb5d64e134137 100644 (file)
@@ -322,6 +322,7 @@ NTSTATUS torture_smb2_testfile(struct smb2_tree *tree, const char *fname,
        r.in.length      = 5;
        r.in.offset      = 0;
 
+       // What is the purpose of this? Server returns EOF.
        smb2_read(tree, tree, &r);
 
        return NT_STATUS_OK;