Hi,

(I would have created a github issue but the "create an issue" button isn't there.  Not sure if there was a recent permissions change or something.)

Was helping a user with an issue in FreeIPMI

https://savannah.gnu.org/support/index.php?110963

where ipmitool was outputting some fan RPMs but FreeIPMI was not. FreeIPMI reports errors from the system when sensors are read.

After looking into it, I believe there is a bug in ipmitool.

In `ipmi_sdr_read_sensor_value()` we have

```
        if (rsp->ccode) {
                if ( !((sr.full    && rsp->ccode == 0xcb) ||
                       (sr.compact && rsp->ccode == 0xcd)) ) {
                        lprintf(LOG_DEBUG,
                                "Error reading sensor %s (#%02x): %s", sr.s_id,
                                sensor->keys.sensor_num,
                                val2str(rsp->ccode, completion_code_vals));
                }
                return &sr;
        }
```

It appears that if a response has a non-zero completion code, optionally output some debugging and then return the sensor reading data structure back to the caller.

In `ipmi_sdr_print_sensor_fc()` we have the call

```
        sr = ipmi_sdr_read_sensor_value(intf, sensor, sdr_record_type, 2);

        if (!sr)
                return -1;
```

So if a response has a non-zero completion code when reading a sensor, we know the sensor reading struct will be returned non-NULL.

So I think the code in `ipmi_sdr_print_sensor_fc()` will continue on its way outputting things assuming the sensor reading was successful, even if it was not.

Al

--
Al Chu
Livermore Computing
Lawrence Livermore National Laboratory



_______________________________________________
Ipmitool-devel mailing list
Ipmitool-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipmitool-devel

Reply via email to