mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-01-22 14:22:19 +08:00
ID:446 - Fix broken firewall reset iterator
The netfn structures are populated sequentially in the _gather_info function and they are accessed only by even indices (and to the double of its real length). This results in a segmentation fault if you run * ipmitool firewall reset This patch fixes the behaviour so that the ipmi_firewall_reset function treats the structure the same way as the rest of the code does. Signed-off-by: Boris Ranto <branto@redhat.com>
This commit is contained in:
parent
0fdfbce8b6
commit
c89be0354a
@ -1135,8 +1135,8 @@ ipmi_firewall_reset(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
|
|
||||||
for (l=0; l<MAX_LUN; l++) {
|
for (l=0; l<MAX_LUN; l++) {
|
||||||
p.lun = l;
|
p.lun = l;
|
||||||
for (n=0; n<MAX_NETFN; n+=2) {
|
for (n=0; n<MAX_NETFN_PAIR; n++) {
|
||||||
p.netfn = n;
|
p.netfn = n*2;
|
||||||
for (c=0; c<MAX_COMMAND; c++) {
|
for (c=0; c<MAX_COMMAND; c++) {
|
||||||
p.command = c;
|
p.command = c;
|
||||||
printf("reset lun %d, netfn %d, command %d, subfn\n", l, n, c);
|
printf("reset lun %d, netfn %d, command %d, subfn\n", l, n, c);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user