Tue 23 Apr 2013 05:12:05 PM UTC, original submission:
Half of the number of records being printed and the same
record id being printed. Example:
# ipmi-dcmi --get-dcmi-sensor-info -h xxx.xxx.xxx.xxx -u xxxxxxxx -p xxxxxxxx -I 1 -l ADMIN -D LAN_2_0
Inlet Temperature SDR Record IDs
18
CPU Temperature SDR Record IDs
19
Baseboard temperature SDR Record IDs
26
26
26
26
Problem is possibly related to suspicious code in ipmi-dcmi.c _sensor_info_output(). Code looks like it results in half the number of records being printed and the same record id being printed.
Current code:
for (i = 0; i < (sdr_record_ids_len / 2); i += 2)
{
uint16_t record_id = 0;
record_id |= sdr_record_ids[0];
record_id |= (sdr_record_ids[1] << 8);
pstdout_printf (state_data->pstate,
"%u\n",
record_id);
total_entity_instances_parsed++;
}
Possible fix???
for (i = 0; i < (sdr_record_ids_len / 2); i += 2)
{
uint16_t record_id = 0;
record_id |= sdr_record_ids[i];
record_id |= (sdr_record_ids[i+1] << 8);
pstdout_printf (state_data->pstate,
"%u\n",
record_id);
total_entity_instances_parsed++;
}
I.e., use the for-loop 'i' as the index, not [0] and [1]. Also, is (sdr_record_ids_len / 2) the correct number of iterations?
|