session_cmds: Validate reserved field content

In "Set Session Privilege Level Command" byte-1’s [7-4] bits and
"CALLBACK" privilege level also reserved. So return
"InvalidFieldRequest" when reserved content is non-zero.

Tested:
Verified using IPMI Command: Set Session Privilege Level Command
Command:  ipmitool -I lanplus -H <BMC-IP> -U <usename> -P <pwd> -C 17
          raw 0x06 0x3B 0x14
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
          cmd=0x3b rsp=0xcc): Invalid data field in request
Command:  ipmitool -I lanplus -H <BMC-IP> -U <usename> -P <pwd> -C 17
          raw 0x06 0x3B 0x4
Response: 04
Command:  ipmitool -I lanplus -H <BMC-IP> -U <usename> -P <pwd> -C 17
          raw 0x06 0x3B 0x01 //Set Session Privilege Level for CALLBACK
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
          cmd=0x3b rsp=0xcc): Invalid data field in request
Command:  ipmitool -I lanplus -H <BMC-IP> -U <usename> -P <pwd> -C 17
          raw 0x06 0x3B 0x05 //Set Session Privilege Level for OEM
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
          cmd=0x3b rsp=0x81): Unknown (0x81)
Command:  ipmitool -I lanplus -H <BMC-IP> -U <usename> -P <pwd> -C 17
          raw 0x06 0x3B 0x06
Response: Unable to send RAW command (channel=0x0 netfn=0x6 lun=0x0
          cmd=0x3b rsp=0xcc): Invalid data field in request

Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: Id76b137112486bb4c617cfa7c861403ce6f6c060
1 file changed