mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-11 02:57:22 +00:00
fix intermittant segfault setting lan parameters
This commit is contained in:
parent
e298b0b99f
commit
1f7ba3dd66
@ -107,6 +107,12 @@ set_lan_param_wait(struct ipmi_intf * intf, unsigned char chan, int param, unsig
|
|||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
p = get_lan_param(intf, chan, param);
|
p = get_lan_param(intf, chan, param);
|
||||||
|
if (!p) {
|
||||||
|
sleep(timeout);
|
||||||
|
if (!retry--)
|
||||||
|
return -1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (verbose > 1)
|
if (verbose > 1)
|
||||||
printbuf(p->data, p->data_len, "READ DATA");
|
printbuf(p->data, p->data_len, "READ DATA");
|
||||||
if (p->data_len != len) {
|
if (p->data_len != len) {
|
||||||
@ -158,8 +164,9 @@ __set_lan_param(struct ipmi_intf * intf, unsigned char chan, int param, unsigned
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (rsp->ccode && wait) {
|
if (rsp->ccode && wait) {
|
||||||
printf("Warning: Set Lan Parameter failed: %s\n",
|
if (verbose)
|
||||||
val2str(rsp->ccode, completion_code_vals));
|
printf("Warning: Set Lan Parameter failed: %s\n",
|
||||||
|
val2str(rsp->ccode, completion_code_vals));
|
||||||
if (rsp->ccode == 0xcc) {
|
if (rsp->ccode == 0xcc) {
|
||||||
/* retry hack for invalid data field ccode */
|
/* retry hack for invalid data field ccode */
|
||||||
int timeout = 3; /* 3 second timeout */
|
int timeout = 3; /* 3 second timeout */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user