From 52f5224ca1075e0263dffc117703eb57c622f0cd Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 14 Jul 2017 16:28:39 -0400 Subject: [PATCH] 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 --- pyghmi/ipmi/private/serversession.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/private/serversession.py b/pyghmi/ipmi/private/serversession.py index 06bcbddb..5cfaaaaa 100644 --- a/pyghmi/ipmi/private/serversession.py +++ b/pyghmi/ipmi/private/serversession.py @@ -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