From 5b7f5d02b5a432fff116f5e2a17e956e3255cd35 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 25 Jun 2012 21:40:00 +0200 Subject: [PATCH] s3:smb2_negprot: support SMB2_CAP_LARGE_MTU on everything but port 139 In future we'll have other transports like RDMA. This makes NBT (tcp port 139) special instead of port 445. metze --- source3/smbd/smb2_negprot.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c index d3a709b159e..c084114ac53 100644 --- a/source3/smbd/smb2_negprot.c +++ b/source3/smbd/smb2_negprot.c @@ -261,15 +261,18 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req) max_limit = 0x10000; if (protocol >= PROTOCOL_SMB2_10) { - /* largeMTU is only available on port 445 */ - if (TCP_SMB_PORT == - tsocket_address_inet_port(req->sconn->local_address)) - { + int p = 0; + if (tsocket_address_is_inet(req->sconn->local_address, "ip")) { + p = tsocket_address_inet_port(req->sconn->local_address); + } + + /* largeMTU is not supported over NBT (tcp port 139) */ + if (p != NBT_SMB_PORT) { capabilities |= SMB2_CAP_LARGE_MTU; req->sconn->smb2.supports_multicredit = true; - /* SMB2.1 has 1 MB of allowed size */ + /* SMB >= 2.1 has 1 MB of allowed size */ max_limit = 0x100000; /* 1MB */ } } -- 2.11.4.GIT