The default is still PROTOCOL_LATEST. As smb2_connect*() is about SMB2/3 only
we upgrade to PROTOCOL_LATEST if PROTOCOL_NT1 or lower is given.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
subreq = smbXcli_negprot_send(state, state->ev,
state->transport->conn, timeout_msec,
- PROTOCOL_SMB2_02, PROTOCOL_LATEST);
+ PROTOCOL_SMB2_02,
+ state->transport->options.max_protocol);
if (tevent_req_nomem(subreq, req)) {
return;
}
transport->ev = sock->event.ctx;
transport->options = *options;
+ if (transport->options.max_protocol == PROTOCOL_DEFAULT) {
+ transport->options.max_protocol = PROTOCOL_LATEST;
+ }
+
+ if (transport->options.max_protocol < PROTOCOL_SMB2_02) {
+ transport->options.max_protocol = PROTOCOL_LATEST;
+ }
+
TALLOC_FREE(sock->event.fde);
TALLOC_FREE(sock->event.te);