]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:smb2_negprot: make use of xconn->transport.type != SMB_TRANSPORT_TYPE_NBT
authorStefan Metzmacher <metze@samba.org>
Fri, 19 Dec 2025 18:35:27 +0000 (19:35 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 16 Jan 2026 12:48:19 +0000 (12:48 +0000)
This is better than relying on the magic port 139.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Jan 16 12:48:19 UTC 2026 on atb-devel-224

source3/smbd/smb2_negprot.c

index 82ca120c2cd2d6b93bf454ef077e2f4a0901ddec..1c3f35c7113006372d0c9e7afa39bedd4d4cd83c 100644 (file)
@@ -433,15 +433,8 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
        max_limit = 0x10000;
 
        if (protocol >= PROTOCOL_SMB2_10) {
-               uint16_t port = 0;
-
-               if (tsocket_address_is_inet(req->sconn->local_address, "ip")) {
-                       port = tsocket_address_inet_port(
-                               req->sconn->local_address);
-               }
-
                /* largeMTU is not supported over NBT (tcp port 139) */
-               if (port != NBT_SMB_PORT) {
+               if (xconn->transport.type != SMB_TRANSPORT_TYPE_NBT) {
                        capabilities |= SMB2_CAP_LARGE_MTU;
                        xconn->smb2.credits.multicredit = true;