2
0
mirror of https://opendev.org/x/pyghmi synced 2025-02-10 07:44:02 +00:00

Avoid creating onlog loops before established

The mechanism to carry over a payload into a new logon
could inadvertently carry over get channel authentication
for example, creating a very confused state.

Change-Id: I29f399006f0c210c80f726e3eb494d3e8b0c3992
This commit is contained in:
Jarrod Johnson 2022-06-14 09:17:17 -04:00
parent a9258c1e9b
commit 13880391c8

View File

@ -1493,7 +1493,7 @@ class Session(object):
def _got_rmcp_response(self, data):
# see RMCP+ open session response table
if not (self.sessioncontext and self.sessioncontext != "Established"):
if not (self.sessioncontext and self.sessioncontext != "ESTABLISHED"):
return -9
# ignore payload as we are not in a state valid it
if data[0] != self.rmcptag:
@ -1763,8 +1763,9 @@ class Session(object):
self._mark_broken()
return
else:
self.onlogpayload = self.lastpayload
self.onlogpayloadtype = self.last_payload_type
if self.sessioncontext == 'ESTABLISHED':
self.onlogpayload = self.lastpayload
self.onlogpayloadtype = self.last_payload_type
self.maxtimeout = 6
self._relog()
return