mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-07-02 10:11:42 +00:00
ID:319 - Interface safe re-open
Currently, interface-management code in the ipmitool does not allow safe interface re-opening (i.e. closing and opening again). It is because the session is allocated in the interface setup callback while is freed in the close callback. So, normal re-opening of the interface, which can be required for example durng the HPM.1 upgrade, leads to segmentation fault. That's why in the ipmi_hpmfwupg.c instead of normal closing interface, directly access the interface data for subsequent re-opening. Commit for Dmitry Bazhenov
This commit is contained in:
@@ -2194,18 +2194,15 @@ HpmfwupgSendCmd(struct ipmi_intf *intf, struct ipmi_rq req,
|
||||
lprintf(LOG_DEBUG, "HPM: try to re-open IOL session");
|
||||
{
|
||||
/* force session re-open */
|
||||
intf->opened = 0;
|
||||
intf->session->authtype = IPMI_SESSION_AUTHTYPE_NONE;
|
||||
intf->session->session_id = 0;
|
||||
intf->session->in_seq = 0;
|
||||
intf->session->out_seq = 0;
|
||||
intf->session->active = 0;
|
||||
intf->session->retry = 10;
|
||||
intf->abort = 1;
|
||||
intf->close(intf);
|
||||
|
||||
while (intf->open(intf) == HPMFWUPG_ERROR
|
||||
&& inaccessTimeoutCounter < inaccessTimeout) {
|
||||
inaccessTimeoutCounter += (time(NULL) - timeoutSec1);
|
||||
timeoutSec1 = time(NULL);
|
||||
}
|
||||
|
||||
/* Fake timeout to retry command */
|
||||
fakeRsp.ccode = 0xc3;
|
||||
rsp = &fakeRsp;
|
||||
|
||||
Reference in New Issue
Block a user