diff options
author | Dan McDonald <danmcd@joyent.com> | 2018-04-30 11:30:28 -0400 |
---|---|---|
committer | Dan McDonald <danmcd@joyent.com> | 2018-05-01 14:39:17 -0400 |
commit | aa321b3cd36298fca4306c4e06284d250e998cf7 (patch) | |
tree | 18dc812ad63350d07928a26101d712d7ae106356 | |
parent | 73769bc1e3c74ccdf2eafae366eacebe85a6f6ff (diff) | |
download | illumos-joyent-aa321b3cd36298fca4306c4e06284d250e998cf7.tar.gz |
9500 HP scanner needs smaller SMB2 rwsize
Reviewed by: Yuri Pankov <yuripv@yuripv.net>
Reviewed by: Andy Fiddaman <omnios@citrus-it.net>
Reviewed by: Bill Sommerfeld <sommerfeld@hamachi.org>
Reviewed by: Toomas Soome <tsoome@me.com>
Approved by: Gordon Ross <gordon.w.ross@gmail.com>
-rw-r--r-- | usr/src/uts/common/fs/smbsrv/smb2_negotiate.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c b/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c index a0affa8a58..a4f827e756 100644 --- a/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c +++ b/usr/src/uts/common/fs/smbsrv/smb2_negotiate.c @@ -50,6 +50,15 @@ uint32_t smb2_max_rwsize = (1<<20); /* 1MB */ uint32_t smb2_max_trans = (1<<16); /* 64KB */ /* + * With clients (e.g. HP scanners) that don't advertise SMB2_CAP_LARGE_MTU + * (including all clients using dialect < SMB 2.1), use a "conservative" value + * for max r/w size because some older clients misbehave with larger values. + * 64KB is recommended in the [MS-SMB2] spec. (3.3.5.3.1 SMB 2.1 or SMB 3.x + * Support) as the minimum so we'll use that. + */ +uint32_t smb2_old_rwsize = (1<<16); /* 64KB */ + +/* * List of all SMB2 versions we implement. Note that the * highest version we support may be limited by the * _cfg.skc_max_protocol setting. @@ -249,6 +258,7 @@ smb2_negotiate_common(smb_request_t *sr, uint16_t version) timestruc_t boot_tv, now_tv; smb_session_t *s = sr->session; int rc; + uint32_t max_rwsize; uint16_t secmode; sr->smb2_status = 0; @@ -297,6 +307,14 @@ smb2_negotiate_common(smb_request_t *sr, uint16_t version) return (-1); /* will drop */ } + /* + * See notes above smb2_max_rwsize, smb2_old_rwsize + */ + if (s->capabilities & SMB2_CAP_LARGE_MTU) + max_rwsize = smb2_max_rwsize; + else + max_rwsize = smb2_old_rwsize; + rc = smb_mbc_encodef( &sr->reply, "wwww#cllllTTwwl#c", @@ -308,8 +326,8 @@ smb2_negotiate_common(smb_request_t *sr, uint16_t version) &s->s_cfg.skc_machine_uuid, /* c */ smb2srv_capabilities, /* l */ smb2_max_trans, /* l */ - smb2_max_rwsize, /* l */ - smb2_max_rwsize, /* l */ + max_rwsize, /* l */ + max_rwsize, /* l */ &now_tv, /* T */ &boot_tv, /* T */ 128, /* SecBufOff */ /* w */ |