Correct the offset to adjust for IPMIv2

For IPMIv2 sessionless data, there is not 13 bytes
to strip out, but instead only 2.  I suspect because
reading the sample packet, the last row unique values
were added without looking at the context.  Correcting
for context, the IPMIv2 header is only two bytes longer.

Change-Id: I9b99417c39f519dfa68b59a90a3ef7ca0232e97e
This commit is contained in:
Jarrod Johnson 2017-07-14 16:28:39 -04:00
parent 45a8facadd
commit 52f5224ca1

View File

@ -317,7 +317,9 @@ class IpmiServer(object):
self.serversocket, data[16:], self.uuid,
bmc=self)
return
data = data[13:] # ditch 13 bytes so the payload works out
# ditch two byte, because ipmi2 header is two
# bytes longer than ipmi1 (payload type added, payload length 2).
data = data[2:]
myaddr, netfnlun = struct.unpack('2B', bytes(data[14:16]))
netfn = (netfnlun & 0b11111100) >> 2
mylun = netfnlun & 0b11