11658 Some capabilities are invalid for SMB 2.002

Review Request #2281 — Created Sept. 5, 2019 and submitted

andy_js
illumos-gate
11658
general

Uncovered by the Windows Protocol Test Suite: SMB2_GLOBAL_CAP_LEASING and SMB2_GLOBAL_CAP_LARGE_MTU and not valid for SMB 2.002 but we set them anyway.

These capabilities were causing an assert to trip in the Windows Protocol Test Suite code. Removing them allows the tests to pass.

andy_js
tsoome
  1. Ship It!
  2. 
      
domag02
  1. Ship It!
  2. 
      
gwr
  1. 
      
  2. OK, but how about introducing another macro, e.g. SMB_20_CAPS right below SMB_2X_CAPS so these are
    described in the same place? (top of this file)

    I'd then also suggest an if/else structure like:

    if (dialect < SMB_VERS_2_1) {
        s->srv_cap = smb2srv_capabilities & SMB_20_CAPS;
    } else if (dialect < SMB_VERS_3_0) {
        (... code as before...)
    } else ...
    
    1. SMB_20_CAPS would be an alias for SMB2_CAP_DFS in this case since it's the only capability supported by SMB 2.02. If feel like it's better to treat it like a special case. Do you still want me to change it?

    2. I guess there's no need for an alias then.
      I'd still like the logic change if you don't mind.

    3. One thing that might not have been obvious is that smb2srv_capabilities was designed to be patchable for testing with some capabilities suppressed. Do you think that needs a comment above that initialization?

    4. I added a comment even though I think it's pretty clear.

  3. 
      
andy_js
gwr
  1. Ship It!
  2. 
      
gdamore
  1. Ship It!
  2. 
      
tsoome
  1. Ship It!
  2. 
      
domag02
  1. Ship It!
  2. 
      
andy_js
Review request changed

Status: Closed (submitted)

Loading...