mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
two changes:
1. the IPMI spec says sessions are opened at USER level and must be increased to desired privilege level. This was not happening for lanplus connections and causing problems with an OSA stack. 2. the 5ms delay between retries was not happening for SOL packets, this is causing problems with a different implementation...
This commit is contained in:
parent
f9e30a894c
commit
ffd03bc964
@ -2094,9 +2094,10 @@ ipmi_lanplus_send_payload(
|
||||
if (rsp)
|
||||
break;
|
||||
|
||||
usleep(5000);
|
||||
}
|
||||
|
||||
usleep(5000);
|
||||
|
||||
try++;
|
||||
}
|
||||
|
||||
@ -3023,6 +3024,44 @@ ipmi_lanplus_close(struct ipmi_intf * intf)
|
||||
|
||||
|
||||
|
||||
static int
|
||||
ipmi_set_session_privlvl_cmd(struct ipmi_intf * intf)
|
||||
{
|
||||
struct ipmi_rs * rsp;
|
||||
struct ipmi_rq req;
|
||||
uint8_t privlvl = intf->session->privlvl;
|
||||
|
||||
if (privlvl <= IPMI_SESSION_PRIV_USER)
|
||||
return 0; /* no need to set higher */
|
||||
|
||||
memset(&req, 0, sizeof(req));
|
||||
req.msg.netfn = IPMI_NETFN_APP;
|
||||
req.msg.cmd = 0x3b;
|
||||
req.msg.data = &privlvl;
|
||||
req.msg.data_len = 1;
|
||||
|
||||
rsp = intf->sendrecv(intf, &req);
|
||||
if (rsp == NULL) {
|
||||
lprintf(LOG_ERR, "Set Session Privilege Level to %s failed",
|
||||
val2str(privlvl, ipmi_privlvl_vals));
|
||||
return -1;
|
||||
}
|
||||
if (verbose > 2)
|
||||
printbuf(rsp->data, rsp->data_len, "set_session_privlvl");
|
||||
|
||||
if (rsp->ccode > 0) {
|
||||
lprintf(LOG_ERR, "Set Session Privilege Level to %s failed: %s",
|
||||
val2str(privlvl, ipmi_privlvl_vals),
|
||||
val2str(rsp->ccode, completion_code_vals));
|
||||
return -1;
|
||||
}
|
||||
|
||||
lprintf(LOG_DEBUG, "Set Session Privilege Level to %s\n",
|
||||
val2str(rsp->data[0], ipmi_privlvl_vals));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* ipmi_lanplus_open
|
||||
*/
|
||||
@ -3174,6 +3213,10 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
|
||||
|
||||
lprintf(LOG_DEBUG, "IPMIv2 / RMCP+ SESSION OPENED SUCCESSFULLY\n");
|
||||
|
||||
rc = ipmi_set_session_privlvl_cmd(intf);
|
||||
if (rc < 0)
|
||||
goto fail;
|
||||
|
||||
return intf->fd;
|
||||
|
||||
fail:
|
||||
|
Loading…
x
Reference in New Issue
Block a user