From 51198a17490e5c81f675fee9a4bb042de65a7a96 Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Sun, 21 Aug 2016 13:16:16 +0200 Subject: [PATCH] ID: 38 - Protocol violating SOL retries when talking to SIMSO-HTC c&p from the ticket: ~~~ When I try to use CVS-ipmitool on Ubuntu 8.04 x86_64 to talk to a SuperMicros SIMSO-HTC (Rev. 2.5, IPMI 2.0) chip on a X7SBi-Board via SOL I often get doubled characters when typing fast, making the SOL interface basically unusable for anyone accustomed to using a keyboard for longer than a month ;) At first I thought this was an issue with SuperMicros implementation of the protocol and/or the flow control setup on the machine, but their own app works fine (but not the Linux CLI, which is maybe based on ipmitool?). But after reading the IPMI 2.0 SOL specs and watching the debug output for a bit, it seems that is really an issue with lanplus-SOL protocol implentation of ipmitool in general. Specifically, in lanplus.c:ipmi_lanplus_send_payload, when waiting for a SOL response the case that a non SOL packet is returned is not being checked. Also the "if (is_sol_packet(rsp) && rsp->data_len)" branch does terminate with a break, but instead goes for a send try, that seems counterintuitive, Both these things cause doubled characters for me. The attached patch seems to solve these issues in my case, but I don't claim to fully understand your protocol code and/or the protocol, so maybe it will cause problems elsewhere, especially under packet loss conditions. ~~~ --- src/plugins/lanplus/lanplus.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/lanplus/lanplus.c b/src/plugins/lanplus/lanplus.c index a9ff926..a0e388c 100644 --- a/src/plugins/lanplus/lanplus.c +++ b/src/plugins/lanplus/lanplus.c @@ -2369,6 +2369,10 @@ ipmi_lanplus_send_payload( rsp = ipmi_lanplus_recv_sol(intf); /* Grab the next packet */ + if (!is_sol_packet(rsp)) { + break; + } + if (sol_response_acks_packet(rsp, payload)) break; @@ -2381,6 +2385,7 @@ ipmi_lanplus_send_payload( intf->session->sol_data.sol_input_handler(rsp); /* In order to avoid duplicate output, just set data_len to 0 */ rsp->data_len = 0; + break; } }