mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-11 19:17:22 +00:00
- fix SOL set errors when commit-write not supported
- fix reset of session timeout for lanplus interface
This commit is contained in:
parent
09a6e0e917
commit
b82cfdf945
@ -543,14 +543,15 @@ ipmi_print_sol_info(struct ipmi_intf * intf, uint8_t channel)
|
|||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ipmi_sol_set_param(struct ipmi_intf * intf,
|
ipmi_sol_set_param(struct ipmi_intf * intf,
|
||||||
uint8_t channel,
|
uint8_t channel,
|
||||||
const char * param,
|
const char * param,
|
||||||
const char * value)
|
const char * value,
|
||||||
|
uint8_t guarded)
|
||||||
{
|
{
|
||||||
struct ipmi_rs * rsp;
|
struct ipmi_rs * rsp;
|
||||||
struct ipmi_rq req;
|
struct ipmi_rq req;
|
||||||
uint8_t data[4];
|
uint8_t data[4];
|
||||||
int bGuarded = 1; /* Use set-in-progress indicator? */
|
int bGuarded = guarded; /* Use set-in-progress indicator? */
|
||||||
|
|
||||||
memset(&req, 0, sizeof(req));
|
memset(&req, 0, sizeof(req));
|
||||||
req.msg.netfn = IPMI_NETFN_TRANSPORT; /* 0x0c */
|
req.msg.netfn = IPMI_NETFN_TRANSPORT; /* 0x0c */
|
||||||
@ -907,9 +908,10 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
|
|||||||
*/
|
*/
|
||||||
if (bGuarded &&
|
if (bGuarded &&
|
||||||
(ipmi_sol_set_param(intf,
|
(ipmi_sol_set_param(intf,
|
||||||
channel,
|
channel,
|
||||||
"set-in-progress",
|
"set-in-progress",
|
||||||
"set-in-progress")))
|
"set-in-progress",
|
||||||
|
bGuarded)))
|
||||||
{
|
{
|
||||||
lprintf(LOG_ERR, "Error: set of parameter \"%s\" failed", param);
|
lprintf(LOG_ERR, "Error: set of parameter \"%s\" failed", param);
|
||||||
return -1;
|
return -1;
|
||||||
@ -924,15 +926,38 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rsp->ccode > 0) {
|
if (!(!strncmp(param, "set-in-progress", 15) && !strncmp(value, "commit-write", 12)) &&
|
||||||
lprintf(LOG_ERR, "Error setting SOL parameter '%s': %s",
|
rsp->ccode > 0) {
|
||||||
param, val2str(rsp->ccode, completion_code_vals));
|
switch (rsp->ccode) {
|
||||||
|
case 0x80:
|
||||||
|
lprintf(LOG_ERR, "Error setting SOL parameter '%s': "
|
||||||
|
"Parameter not supported", param);
|
||||||
|
break;
|
||||||
|
case 0x81:
|
||||||
|
lprintf(LOG_ERR, "Error setting SOL parameter '%s': "
|
||||||
|
"Attempt to set set-in-progress when not in set-complete state",
|
||||||
|
param);
|
||||||
|
break;
|
||||||
|
case 0x82:
|
||||||
|
lprintf(LOG_ERR, "Error setting SOL parameter '%s': "
|
||||||
|
"Attempt to write read-only parameter", param);
|
||||||
|
break;
|
||||||
|
case 0x83:
|
||||||
|
lprintf(LOG_ERR, "Error setting SOL parameter '%s': "
|
||||||
|
"Attempt to read write-only parameter", param);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
lprintf(LOG_ERR, "Error setting SOL parameter '%s' to '%s': %s",
|
||||||
|
param, value, val2str(rsp->ccode, completion_code_vals));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (bGuarded &&
|
if (bGuarded &&
|
||||||
(ipmi_sol_set_param(intf,
|
(ipmi_sol_set_param(intf,
|
||||||
channel,
|
channel,
|
||||||
"set-in-progress",
|
"set-in-progress",
|
||||||
"set-complete")))
|
"set-complete",
|
||||||
|
bGuarded)))
|
||||||
{
|
{
|
||||||
lprintf(LOG_ERR, "Error could not set \"set-in-progress\" "
|
lprintf(LOG_ERR, "Error could not set \"set-in-progress\" "
|
||||||
"to \"set-complete\"");
|
"to \"set-complete\"");
|
||||||
@ -948,16 +973,18 @@ ipmi_sol_set_param(struct ipmi_intf * intf,
|
|||||||
*/
|
*/
|
||||||
if (bGuarded)
|
if (bGuarded)
|
||||||
ipmi_sol_set_param(intf,
|
ipmi_sol_set_param(intf,
|
||||||
channel,
|
channel,
|
||||||
"set-in-progress",
|
"set-in-progress",
|
||||||
"commit-write");
|
"commit-write",
|
||||||
|
bGuarded);
|
||||||
|
|
||||||
|
|
||||||
if (bGuarded &&
|
if (bGuarded &&
|
||||||
ipmi_sol_set_param(intf,
|
ipmi_sol_set_param(intf,
|
||||||
channel,
|
channel,
|
||||||
"set-in-progress",
|
"set-in-progress",
|
||||||
"set-complete"))
|
"set-complete",
|
||||||
|
bGuarded))
|
||||||
{
|
{
|
||||||
lprintf(LOG_ERR, "Error could not set \"set-in-progress\" "
|
lprintf(LOG_ERR, "Error could not set \"set-in-progress\" "
|
||||||
"to \"set-complete\"");
|
"to \"set-complete\"");
|
||||||
@ -992,8 +1019,7 @@ enter_raw_mode(void)
|
|||||||
}
|
}
|
||||||
_saved_tio = tio;
|
_saved_tio = tio;
|
||||||
tio.c_iflag |= IGNPAR;
|
tio.c_iflag |= IGNPAR;
|
||||||
tio.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF)\
|
tio.c_iflag &= ~(ISTRIP | INLCR | IGNCR | ICRNL | IXON | IXANY | IXOFF);
|
||||||
;
|
|
||||||
tio.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
|
tio.c_lflag &= ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL);
|
||||||
// #ifdef IEXTEN
|
// #ifdef IEXTEN
|
||||||
tio.c_lflag &= ~IEXTEN;
|
tio.c_lflag &= ~IEXTEN;
|
||||||
@ -1699,22 +1725,33 @@ ipmi_sol_main(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
* Set a parameter value
|
* Set a parameter value
|
||||||
*/
|
*/
|
||||||
else if (!strncmp(argv[0], "set", 3)) {
|
else if (!strncmp(argv[0], "set", 3)) {
|
||||||
uint8_t channel;
|
uint8_t channel = 0xe;
|
||||||
|
uint8_t guard = 1;
|
||||||
|
|
||||||
if (argc == 3)
|
if (argc == 3)
|
||||||
channel = 0x0E; /* Ask about the current channel */
|
{
|
||||||
|
channel = 0xe;
|
||||||
|
}
|
||||||
else if (argc == 4)
|
else if (argc == 4)
|
||||||
|
{
|
||||||
|
if (!strncmp(argv[3], "noguard", 7))
|
||||||
|
guard = 0;
|
||||||
|
else
|
||||||
|
channel = (uint8_t)strtol(argv[3], NULL, 0);
|
||||||
|
}
|
||||||
|
else if (argc == 5)
|
||||||
|
{
|
||||||
channel = (uint8_t)strtol(argv[3], NULL, 0);
|
channel = (uint8_t)strtol(argv[3], NULL, 0);
|
||||||
|
if (!strncmp(argv[4], "noguard", 7))
|
||||||
|
guard = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print_sol_set_usage();
|
print_sol_set_usage();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = ipmi_sol_set_param(intf,
|
retval = ipmi_sol_set_param(intf, channel, argv[1], argv[2], guard);
|
||||||
channel,
|
|
||||||
argv[1],
|
|
||||||
argv[2]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2226,6 +2226,9 @@ ipmi_lanplus_send_payload(
|
|||||||
try++;
|
try++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Reset timeout after retry loop completes */
|
||||||
|
intf->session->timeout = IPMI_LAN_TIMEOUT;
|
||||||
|
|
||||||
/* IPMI messages are deleted under ipmi_lan_poll_recv() */
|
/* IPMI messages are deleted under ipmi_lan_poll_recv() */
|
||||||
switch (payload->payload_type) {
|
switch (payload->payload_type) {
|
||||||
case IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST:
|
case IPMI_PAYLOAD_TYPE_RMCP_OPEN_REQUEST:
|
||||||
|
@ -226,16 +226,15 @@ int lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
|
|||||||
/* Intel BMC responds with the integrity Algorithm in RAKP4 */
|
/* Intel BMC responds with the integrity Algorithm in RAKP4 */
|
||||||
if (session->v2_data.integrity_alg == IPMI_INTEGRITY_NONE)
|
if (session->v2_data.integrity_alg == IPMI_INTEGRITY_NONE)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* We don't yet support other algorithms */
|
/* We don't yet support other algorithms */
|
||||||
assert(session->v2_data.integrity_alg == IPMI_INTEGRITY_HMAC_SHA1_96);
|
assert(session->v2_data.integrity_alg == IPMI_INTEGRITY_HMAC_SHA1_96);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE)
|
if (session->v2_data.auth_alg == IPMI_AUTH_RAKP_NONE)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* We don't yet support other algorithms */
|
/* We don't yet support other algorithms */
|
||||||
assert(session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1);
|
assert(session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1);
|
||||||
}
|
}
|
||||||
|
|
||||||
bufferLength =
|
bufferLength =
|
||||||
@ -905,4 +904,3 @@ int lanplus_decrypt_payload(uint8_t crypt_alg,
|
|||||||
free(decrypted_payload);
|
free(decrypted_payload);
|
||||||
return (bytes_decrypted == 0);
|
return (bytes_decrypted == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user