From fbd95bc3b3de455bab08d40af94c6fd21255f4ae Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 10 Nov 2015 14:42:13 -0500 Subject: [PATCH] Avoid abandoning retry when SOL packet is not ACK The design was to abandon retry when data comes in, ACK or not. This became a problem when console.py retried under frantic conditions, confusing some BMC implementations, and so that was removed. With that removed, BMC traffic was still cancelling the retry, but nothing was reinstated in retry anymore. Fix by having session.py understand a few bits of SOL payload enough to identify at least if it is *an* ACK at all. If it's one of the 'weird' ACK scenarios, sol handler still must handle, but simple no-ACK scenario now contained in session.py. Change-Id: I609ff783cd6cc2bf431271280bb55da4126f2cfc --- pyghmi/ipmi/private/session.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pyghmi/ipmi/private/session.py b/pyghmi/ipmi/private/session.py index ee1b751d..4013b959 100644 --- a/pyghmi/ipmi/private/session.py +++ b/pyghmi/ipmi/private/session.py @@ -1190,11 +1190,13 @@ class Session(object): if ptype == 0: self._parse_ipmi_payload(payload) elif ptype == 1: # There should be no other option - # note that we assume the SOL payload is good enough to avoid - # retry SOL logic is sufficiently different, we just - # defer that call to the sol handler, it can re submit if it - # is unhappy - if self.last_payload_type == 1: # but only if SOL was last tx + if (payload[1] & 0b1111) and self.last_payload_type == 1: + # for ptype 1, the 4 least significant bits of 2nd byte + # is the ACK number. + # if it isn't an ACK at all, we'll keep retrying, however + # if it's a subtle SOL situation (partial ACK, wrong ACK) + # then sol_handler will have to resubmit and we will + # stop the generic retry behavior here self.lastpayload = None self.last_payload_type = None Session.waiting_sessions.pop(self, None)