mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-11 11:07:23 +00:00
Display message and exit if keepalive fails during SOL
This commit is contained in:
parent
d80fa31411
commit
64af2f2bdb
@ -7,6 +7,7 @@ version 1.8.7
|
|||||||
* Add support for IBM OEM SEL messages
|
* Add support for IBM OEM SEL messages
|
||||||
* Disable file paranoia checks on read files by default
|
* Disable file paranoia checks on read files by default
|
||||||
* Support IPMIv2 SOL on older Intel boxes
|
* Support IPMIv2 SOL on older Intel boxes
|
||||||
|
* Display message and exit if keepalive fails during SOL
|
||||||
|
|
||||||
version 1.8.6
|
version 1.8.6
|
||||||
* Fix memory corruption when sending encrypted SOL traffic
|
* Fix memory corruption when sending encrypted SOL traffic
|
||||||
|
@ -1278,17 +1278,20 @@ processSolUserInput(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
static int
|
||||||
ipmi_sol_keepalive(struct ipmi_intf * intf)
|
ipmi_sol_keepalive(struct ipmi_intf * intf)
|
||||||
{
|
{
|
||||||
struct timeval end;
|
struct timeval end;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
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) {
|
||||||
intf->keepalive(intf);
|
ret = intf->keepalive(intf);
|
||||||
gettimeofday(&_start_keepalive, 0);
|
gettimeofday(&_start_keepalive, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1307,6 +1310,7 @@ ipmi_sol_red_pill(struct ipmi_intf * intf)
|
|||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
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;
|
||||||
|
|
||||||
buffer = (char*)malloc(buffer_size);
|
buffer = (char*)malloc(buffer_size);
|
||||||
if (buffer == NULL) {
|
if (buffer == NULL) {
|
||||||
@ -1326,7 +1330,13 @@ ipmi_sol_red_pill(struct ipmi_intf * intf)
|
|||||||
FD_SET(intf->fd, &read_fds);
|
FD_SET(intf->fd, &read_fds);
|
||||||
|
|
||||||
/* Send periodic keepalive packet */
|
/* Send periodic keepalive packet */
|
||||||
ipmi_sol_keepalive(intf);
|
keepAliveRet = ipmi_sol_keepalive(intf);
|
||||||
|
if (keepAliveRet != 0)
|
||||||
|
{
|
||||||
|
/* no response to keepalive message */
|
||||||
|
bShouldExit = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Wait up to half a second */
|
/* Wait up to half a second */
|
||||||
tv.tv_sec = 0;
|
tv.tv_sec = 0;
|
||||||
@ -1401,6 +1411,14 @@ ipmi_sol_red_pill(struct ipmi_intf * intf)
|
|||||||
|
|
||||||
leave_raw_mode();
|
leave_raw_mode();
|
||||||
|
|
||||||
|
if (keepAliveRet != 0)
|
||||||
|
{
|
||||||
|
lprintf(LOG_ERR, "Error: No response to keepalive - Terminating session");
|
||||||
|
/* attempt to clean up anyway */
|
||||||
|
ipmi_sol_deactivate(intf);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if (bBmcClosedSession)
|
if (bBmcClosedSession)
|
||||||
{
|
{
|
||||||
lprintf(LOG_ERR, "SOL session closed by BMC");
|
lprintf(LOG_ERR, "SOL session closed by BMC");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user