s4:libcli/smb2: ignore SMB2_OP_CANCEL responses
authorStefan Metzmacher <metze@samba.org>
Wed, 28 Sep 2011 06:23:24 +0000 (08:23 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 28 Sep 2011 15:29:12 +0000 (17:29 +0200)
If there're a problem with signing or the session doesn't exists
any more the server responses with a failure, instead of not
sending a response.

For now we ignore the reponse, as there's not much we could do with it
and it's not likely that we generate bad requests, which trigger
that behavior, except for testing.

metze

source4/libcli/smb2/transport.c

index a1653e39746788d03b02157e9c27695b83c5d715..c17bbfde46ec502f379bde5b9bfcdcfc53456d46 100644 (file)
@@ -277,6 +277,16 @@ static NTSTATUS smb2_transport_finish_recv(void *private_data, DATA_BLOB blob)
                return smb2_handle_oplock_break(transport, &blob);
        }
 
+       if (opcode == SMB2_OP_CANCEL) {
+               /*
+                * ignore responses to cancel requests,
+                * this can happen if signing was wrong or
+                * we specified the wrong session id
+                */
+               talloc_free(buffer);
+               return NT_STATUS_OK;
+       }
+
        /* match the incoming request against the list of pending requests */
        for (req=transport->pending_recv; req; req=req->next) {
                if (req->seqnum == seqnum) break;