If we already have an smb1req attached to the struct smbd_smb2_request, don't recreat...
authorJeremy Allison <jra@samba.org>
Tue, 19 Mar 2013 19:16:32 +0000 (12:16 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 19 Apr 2013 21:10:47 +0000 (14:10 -0700)
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan (metze) Metzmacher <metze@samba.org>
source3/smbd/smb2_glue.c

index 1b2b4dd693f21f1cc50d3628a2aee7596a5bedb2..9fc1e49c2e5fa91c442988497df59f0c69bb956a 100644 (file)
@@ -28,9 +28,13 @@ struct smb_request *smbd_smb2_fake_smb_request(struct smbd_smb2_request *req)
        struct smb_request *smbreq;
        const uint8_t *inhdr = SMBD_SMB2_IN_HDR_PTR(req);
 
-       smbreq = talloc_zero(req, struct smb_request);
-       if (smbreq == NULL) {
-               return NULL;
+       if (req->smb1req) {
+               smbreq = req->smb1req;
+       } else {
+               smbreq = talloc_zero(req, struct smb_request);
+               if (smbreq == NULL) {
+                       return NULL;
+               }
        }
 
        smbreq->request_time = req->request_time;