From 6f807ebc428ffff8de9d10ac5fbbfeec0f3a5a2a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 4 May 2016 10:40:05 -0400 Subject: [PATCH] Fix IPMI server functionality When data steering was implemented to improve performance, the server component was not updated to be able to receive steered data. Update the server component with the needed interfaces to be compatible with the performance enhancement. Change-Id: I251cfaaf80d7ae45b60f03e39a46a683d913396b --- pyghmi/ipmi/private/serversession.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pyghmi/ipmi/private/serversession.py b/pyghmi/ipmi/private/serversession.py index ce184d18..3ea6568d 100644 --- a/pyghmi/ipmi/private/serversession.py +++ b/pyghmi/ipmi/private/serversession.py @@ -17,6 +17,7 @@ # This represents the server side of a session object # Split into a separate file to avoid overly manipulating the as-yet # client-centered session object +import collections import hashlib import hmac import os @@ -74,6 +75,7 @@ class ServerSession(ipmisession.Session): self.kg = kg self.socket = netsocket self.sockaddr = clientaddr + self.pktqueue = collections.deque([]) ipmisession.Session.bmc_handlers[clientaddr] = self response = self.create_open_session_response(request) self.send_payload(response, @@ -250,6 +252,7 @@ class IpmiServer(object): self.additionaldevices = 0 self.mfgid = 0 self.prodid = 0 + self.pktqueue = collections.deque([]) if bmcuuid is None: self.uuid = uuid.uuid4() else: @@ -279,6 +282,11 @@ class IpmiServer(object): header += chr(ipmisession._checksum(*bodydata)) ipmisession._io_sendto(self.serversocket, header, sockaddr) + def process_pktqueue(self): + while self.pktqueue: + pkt = self.pktqueue.popleft() + self.sessionless_data(pkt[0], pkt[1]) + def sessionless_data(self, data, sockaddr): """Examines unsolocited packet and decides appropriate action.