This patch series fixes establishment of NetBIOS session for SMB2+ connections which is currently broken. Tested with SMB3 dialect against Windows Server 2022. Also it improves autodetection whether NetBIOS session is needed on specified server port, and allows to initialize NetBIOS session also over other port than 139. This is needed when testing against virtual machines when port 139 is forwarded over some non-system port. Pali Rohár (6): cifs: Allow to disable or force initialization of NetBIOS session cifs: Fix establishing NetBIOS session for SMB2+ connection cifs: Improve establishing SMB connection with NetBIOS session cifs: Improve handling of NetBIOS packets cifs: Fix negotiate retry functionality cifs: Set default Netbios RFC1001 server name to hostname in UNC fs/smb/client/cifsglob.h | 4 + fs/smb/client/cifsproto.h | 3 + fs/smb/client/connect.c | 316 ++++++++++++++++++++++++++++++++++--- fs/smb/client/fs_context.c | 25 ++- fs/smb/client/fs_context.h | 2 + fs/smb/client/smb1ops.c | 7 - fs/smb/client/smb2ops.c | 3 - fs/smb/client/transport.c | 5 +- 8 files changed, 327 insertions(+), 38 deletions(-) -- 2.20.1