From: Stefan Metzmacher Date: Wed, 1 Jul 2020 16:37:44 +0000 (+0200) Subject: s4:torture/smb2: make use of transport_options.only_negprot for multichannel connections X-Git-Tag: samba-4.13.0rc1~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3559a1df9bc80bf3b2a11faf020149dd9facfe4c;p=thirdparty%2Fsamba.git s4:torture/smb2: make use of transport_options.only_negprot for multichannel connections 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 Reviewed-by: Günther Deschner --- diff --git a/source4/torture/smb2/multichannel.c b/source4/torture/smb2/multichannel.c index 714f150d51e..9cbfdf2c3f0 100644 --- a/source4/torture/smb2/multichannel.c +++ b/source4/torture/smb2/multichannel.c @@ -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; }