]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:torture/smb2: make use of transport_options.only_negprot for multichannel connections
authorStefan Metzmacher <metze@samba.org>
Wed, 1 Jul 2020 16:37:44 +0000 (18:37 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 8 Jul 2020 15:54:38 +0000 (15:54 +0000)
This avoid useless session setups and tree connects on the wire.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11897

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
source4/torture/smb2/multichannel.c

index 714f150d51e313421157c53a35e0695c329c7b42..9cbfdf2c3f02acdb4abb4a4c34e31e75378524a3 100644 (file)
@@ -168,16 +168,21 @@ static struct smb2_tree *test_multichannel_create_channel(
                                const char *host,
                                const char *share,
                                struct cli_credentials *credentials,
-                               const struct smbcli_options *transport_options,
+                               const struct smbcli_options *_transport_options,
                                struct smb2_tree *parent_tree
                                )
 {
+       struct smbcli_options transport_options = *_transport_options;
        NTSTATUS status;
        struct smb2_transport *transport;
        struct smb2_session *session;
        bool ret = true;
        struct smb2_tree *tree;
 
+       if (parent_tree) {
+               transport_options.only_negprot = true;
+       }
+
        status = smb2_connect(tctx,
                        host,
                        lpcfg_smb_ports(tctx->lp_ctx),
@@ -186,7 +191,7 @@ static struct smb2_tree *test_multichannel_create_channel(
                        credentials,
                        &tree,
                        tctx->ev,
-                       transport_options,
+                       &transport_options,
                        lpcfg_socket_options(tctx->lp_ctx),
                        lpcfg_gensec_settings(tctx, tctx->lp_ctx)
                        );
@@ -1804,7 +1809,13 @@ static bool test_multichannel_num_channels(struct torture_context *tctx,
                transport2[i] = tree2[i]->session->transport;
 
                if (i == 0) {
-                       /* done for the 1st channel */
+                       /*
+                        * done for the 1st channel
+                        *
+                        * For all remaining channels we do the
+                        * session setup on our own.
+                        */
+                       transport2_options.only_negprot = true;
                        continue;
                }