freeipmi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Freeipmi-devel] [bug #38814] ipmi-dcmi --get-dcmi-sensor-info command r


From: Michael Winiarski
Subject: [Freeipmi-devel] [bug #38814] ipmi-dcmi --get-dcmi-sensor-info command returns incorrect data
Date: Tue, 23 Apr 2013 17:12:06 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0) Gecko/20100101 Firefox/20.0

URL:
  <http://savannah.gnu.org/bugs/?38814>

                 Summary: ipmi-dcmi --get-dcmi-sensor-info command returns
incorrect data
                 Project: GNU FreeIPMI
            Submitted by: mwiniarski
            Submitted on: Tue 23 Apr 2013 05:12:05 PM GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Improper Behaviour
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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?





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?38814>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]