mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
Add retries to SOL keepalive attempts; Based on Harshad Prabhu's patch with additional changes made mostly to improve readability
This commit is contained in:
parent
d0155c3917
commit
c23b875c8b
@ -71,6 +71,8 @@
|
|||||||
#define SOL_PARAMETER_SOL_PAYLOAD_CHANNEL 0x07
|
#define SOL_PARAMETER_SOL_PAYLOAD_CHANNEL 0x07
|
||||||
#define SOL_PARAMETER_SOL_PAYLOAD_PORT 0x08
|
#define SOL_PARAMETER_SOL_PAYLOAD_PORT 0x08
|
||||||
|
|
||||||
|
#define MAX_SOL_RETRY 6
|
||||||
|
|
||||||
const struct valstr sol_parameter_vals[] = {
|
const struct valstr sol_parameter_vals[] = {
|
||||||
{ SOL_PARAMETER_SET_IN_PROGRESS, "Set In Progress (0)" },
|
{ SOL_PARAMETER_SET_IN_PROGRESS, "Set In Progress (0)" },
|
||||||
{ SOL_PARAMETER_SOL_ENABLE, "Enable (1)" },
|
{ SOL_PARAMETER_SOL_ENABLE, "Enable (1)" },
|
||||||
@ -1418,8 +1420,6 @@ ipmi_sol_keepalive_using_getdeviceid(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ipmi_sol_red_pill
|
* ipmi_sol_red_pill
|
||||||
*/
|
*/
|
||||||
@ -1435,6 +1435,7 @@ ipmi_sol_red_pill(struct ipmi_intf * intf)
|
|||||||
int retval;
|
int retval;
|
||||||
int buffer_size = intf->session->sol_data.max_inbound_payload_size;
|
int buffer_size = intf->session->sol_data.max_inbound_payload_size;
|
||||||
int keepAliveRet = 0;
|
int keepAliveRet = 0;
|
||||||
|
int retrySol = 0;
|
||||||
|
|
||||||
buffer = (char*)malloc(buffer_size);
|
buffer = (char*)malloc(buffer_size);
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
@ -1465,10 +1466,30 @@ ipmi_sol_red_pill(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
if (keepAliveRet != 0)
|
if (keepAliveRet != 0)
|
||||||
{
|
{
|
||||||
/* no response to keepalive message */
|
/*
|
||||||
|
* Retrying the keep Alive before declaring a communication
|
||||||
|
* lost state with the IPMC. Helpful when the payload is
|
||||||
|
* reset and brings down the connection temporarily. Otherwise,
|
||||||
|
* if we send getDevice Id to check the status of IPMC during
|
||||||
|
* this down time when the connection is restarting, SOL will
|
||||||
|
* exit even though the IPMC is available and the session is open.
|
||||||
|
*/
|
||||||
|
if (retrySol == MAX_SOL_RETRY)
|
||||||
|
{
|
||||||
|
/* no response to Get Device ID keepalive message */
|
||||||
bShouldExit = 1;
|
bShouldExit = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
retrySol++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* if the keep Alive is successful reset retries to zero */
|
||||||
|
retrySol = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Wait up to half a second */
|
/* Wait up to half a second */
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user