mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
ID#340 - ipmitool sol session improperly closes on packet retry
Commit for Pat Donlin
This commit is contained in:
parent
deb9a4ed5d
commit
21fbd0e967
@ -1477,11 +1477,8 @@ static int
|
|||||||
ipmi_sol_keepalive_using_sol(struct ipmi_intf * intf)
|
ipmi_sol_keepalive_using_sol(struct ipmi_intf * intf)
|
||||||
{
|
{
|
||||||
struct ipmi_v2_payload v2_payload;
|
struct ipmi_v2_payload v2_payload;
|
||||||
struct ipmi_rs * rsp = NULL;
|
|
||||||
struct timeval end;
|
struct timeval end;
|
||||||
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
if (_disable_keepalive)
|
if (_disable_keepalive)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -1489,21 +1486,19 @@ ipmi_sol_keepalive_using_sol(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
if (end.tv_sec - _start_keepalive.tv_sec > SOL_KEEPALIVE_TIMEOUT) {
|
if (end.tv_sec - _start_keepalive.tv_sec > SOL_KEEPALIVE_TIMEOUT) {
|
||||||
memset(&v2_payload, 0, sizeof(v2_payload));
|
memset(&v2_payload, 0, sizeof(v2_payload));
|
||||||
|
|
||||||
v2_payload.payload.sol_packet.character_count = 0;
|
v2_payload.payload.sol_packet.character_count = 0;
|
||||||
|
if (intf->send_sol(intf, &v2_payload) == NULL)
|
||||||
rsp = intf->send_sol(intf, &v2_payload);
|
return -1;
|
||||||
|
/* good return, reset start time */
|
||||||
gettimeofday(&_start_keepalive, 0);
|
gettimeofday(&_start_keepalive, 0);
|
||||||
}
|
}
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ipmi_sol_keepalive_using_getdeviceid(struct ipmi_intf * intf)
|
ipmi_sol_keepalive_using_getdeviceid(struct ipmi_intf * intf)
|
||||||
{
|
{
|
||||||
struct timeval end;
|
struct timeval end;
|
||||||
static int ret = 0;
|
|
||||||
|
|
||||||
if (_disable_keepalive)
|
if (_disable_keepalive)
|
||||||
return 0;
|
return 0;
|
||||||
@ -1511,16 +1506,12 @@ ipmi_sol_keepalive_using_getdeviceid(struct ipmi_intf * intf)
|
|||||||
gettimeofday(&end, 0);
|
gettimeofday(&end, 0);
|
||||||
|
|
||||||
if (end.tv_sec - _start_keepalive.tv_sec > SOL_KEEPALIVE_TIMEOUT) {
|
if (end.tv_sec - _start_keepalive.tv_sec > SOL_KEEPALIVE_TIMEOUT) {
|
||||||
ret = intf->keepalive(intf);
|
if (intf->keepalive(intf) != 0)
|
||||||
if ( (ret!=0) && (_keepalive_retries < SOL_KEEPALIVE_RETRIES) ) {
|
return -1;
|
||||||
ret = 0;
|
/* good return, reset start time */
|
||||||
_keepalive_retries++;
|
|
||||||
}
|
|
||||||
else if ((ret==0) && (_keepalive_retries > 0))
|
|
||||||
_keepalive_retries = 0;
|
|
||||||
gettimeofday(&_start_keepalive, 0);
|
gettimeofday(&_start_keepalive, 0);
|
||||||
}
|
}
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1653,14 +1644,15 @@ ipmi_sol_red_pill(struct ipmi_intf * intf, int instance)
|
|||||||
else if (FD_ISSET(intf->fd, &read_fds))
|
else if (FD_ISSET(intf->fd, &read_fds))
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rs =intf->recv_sol(intf);
|
struct ipmi_rs * rs =intf->recv_sol(intf);
|
||||||
if (! rs)
|
if ( rs)
|
||||||
{
|
|
||||||
bShouldExit = bBmcClosedSession = 1;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
output(rs);
|
output(rs);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* Should recv_sol come back null, the incoming packet was not ours.
|
||||||
|
* Just fall through, the keepalive logic will determine if
|
||||||
|
* the BMC has dropped the session.
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user