11
29
Fork
You've already forked ipmitool
33

dcmi sensors duplicates the 8th sensor entry when more than 8 sensors are present #87

Open
opened 2026年06月08日 05:38:04 +02:00 by cpt1020 · 0 comments

Describe the bug

When more than 8 temperature sensors are present for a DCMI sensor category, ipmitool dcmi sensors duplicates the 8th sensor entry

IPMITOOL Version

$ ipmitool -V
ipmitool version 1.8.19.59.gd62a996

To Reproduce

Steps to reproduce the behavior:

  1. Build the latest code from the current master branch.
  2. Connect to a BMC that reports more than 8 sensors in a DCMI temperature sensor category.
  3. Run ipmitool -I lanplus -H <bmc-ip> -U <user> -P <password> dcmi sensors
  4. Observe the abnormal reply:
Baseboard: 10 temperature sensors found:
Record ID 0x000a: TEMP01 | 22 degrees C | ok
Record ID 0x0014: TEMP02 | 20 degrees C | ok
Record ID 0x0015: TEMP03 | 20 degrees C | ok
Record ID 0x0017: TEMP04 | 22 degrees C | ok
Record ID 0x0018: TEMP05 | 47 degrees C | ok
Record ID 0x0019: TEMP06 | 45 degrees C | ok
Record ID 0x001a: TEMP07 | 46 degrees C | ok
Record ID 0x001b: TEMP08 | 45 degrees C | ok
Record ID 0x001b: TEMP08 | 45 degrees C | ok
Record ID 0x001c: TEMP09 | 21 degrees C | ok
Record ID 0x001d: TEMP10 | 21 degrees C | ok

Expected behavior

The sensor list should continue from the 9th sensor without duplicating the 8th entry:

Record ID 0x001a: TEMP07
Record ID 0x001b: TEMP08
Record ID 0x001c: TEMP09
Record ID 0x001d: TEMP10

No duplicate sensor entries should be reported.

Additional context

While investigating the issue, I noticed that the duplicated entry seems to be related to the offset used in ipmi_dcmi_prnt_discvry_snsr(), which is passed directly as the DCMI request's Entity Instance Start field:

// ipmi_dcmi_discvry_snsr()

	msg_data[0] = IPMI_DCMI; /* Group Extension Identification */
	msg_data[1] = 0x01; /* Senser Type = Temp (01h) */
	msg_data[2] = isnsr; /* Sensor Number */
	msg_data[3] = 0x00; /* Entity Instance, set to read all instances */
	msg_data[4] = offset; /* Entity instance start */

According to DCMI v1.5, Table 6-14, DCMI Entity Instance values are defined as:

0x01 ... n

and Table 6-15 defines request byte 5 as:

Entity Instance Start
Used with Entity Instance 00h for # of instance exceeding one IPMI Response

Since offset is used as the request's Entity Instance Start, the first request currently uses:

Entity Instance = 00h
Entity Instance Start = 00h

while the DCMI Entity Instance numbering appears to start from 1.

In my test environment, initializing the offset to 1 instead of 0 avoids the duplicated 8th entry:

~/ipmitool (master)$ git diff
diff --git a/lib/ipmi_dcmi.c b/lib/ipmi_dcmi.c
index 90db253..b1702d6 100644
--- a/lib/ipmi_dcmi.c
+++ b/lib/ipmi_dcmi.c
@@ -1355,7 +1355,7 @@ ipmi_dcmi_prnt_discvry_snsr(struct ipmi_intf * intf, uint8_t isnsr)
 struct ipmi_rs * rsp; /* ipmi response */
 uint8_t records = 0;
 int8_t instances = 0;
- uint8_t offset = 0;
+ uint8_t offset = 1;
 uint16_t record_id = 0;
 uint8_t id_buff[16]; /* enough for 8 record IDs */
 rsp = ipmi_dcmi_discvry_snsr(intf, isnsr, 0);

After this change, the sensor list continues from TEMP09 instead of repeating TEMP08.
I can submit a pull request if this is considered the correct fix.

**Describe the bug** When more than 8 temperature sensors are present for a DCMI sensor category, `ipmitool dcmi sensors` duplicates the 8th sensor entry **IPMITOOL Version** ```none $ ipmitool -V ipmitool version 1.8.19.59.gd62a996 ``` **To Reproduce** Steps to reproduce the behavior: 1. Build the latest code from the current master branch. 2. Connect to a BMC that reports more than 8 sensors in a DCMI temperature sensor category. 3. Run `ipmitool -I lanplus -H <bmc-ip> -U <user> -P <password> dcmi sensors` 4. Observe the abnormal reply: ```none Baseboard: 10 temperature sensors found: Record ID 0x000a: TEMP01 | 22 degrees C | ok Record ID 0x0014: TEMP02 | 20 degrees C | ok Record ID 0x0015: TEMP03 | 20 degrees C | ok Record ID 0x0017: TEMP04 | 22 degrees C | ok Record ID 0x0018: TEMP05 | 47 degrees C | ok Record ID 0x0019: TEMP06 | 45 degrees C | ok Record ID 0x001a: TEMP07 | 46 degrees C | ok Record ID 0x001b: TEMP08 | 45 degrees C | ok Record ID 0x001b: TEMP08 | 45 degrees C | ok Record ID 0x001c: TEMP09 | 21 degrees C | ok Record ID 0x001d: TEMP10 | 21 degrees C | ok ``` **Expected behavior** The sensor list should continue from the 9th sensor without duplicating the 8th entry: ```none Record ID 0x001a: TEMP07 Record ID 0x001b: TEMP08 Record ID 0x001c: TEMP09 Record ID 0x001d: TEMP10 ``` No duplicate sensor entries should be reported. **Additional context** While investigating the issue, I noticed that the duplicated entry seems to be related to the `offset` used in `ipmi_dcmi_prnt_discvry_snsr()`, which is passed directly as the DCMI request's `Entity Instance Start` field: ```cpp // ipmi_dcmi_discvry_snsr() msg_data[0] = IPMI_DCMI; /* Group Extension Identification */ msg_data[1] = 0x01; /* Senser Type = Temp (01h) */ msg_data[2] = isnsr; /* Sensor Number */ msg_data[3] = 0x00; /* Entity Instance, set to read all instances */ msg_data[4] = offset; /* Entity instance start */ ``` According to DCMI v1.5, Table 6-14, DCMI Entity Instance values are defined as: ```none 0x01 ... n ``` and Table 6-15 defines request byte 5 as: > Entity Instance Start > Used with Entity Instance 00h for # of instance exceeding one IPMI Response Since offset is used as the request's `Entity Instance Start`, the first request currently uses: ```none Entity Instance = 00h Entity Instance Start = 00h ``` while the DCMI Entity Instance numbering appears to start from 1. In my test environment, initializing the `offset` to 1 instead of 0 avoids the duplicated 8th entry: ```diff ~/ipmitool (master)$ git diff diff --git a/lib/ipmi_dcmi.c b/lib/ipmi_dcmi.c index 90db253..b1702d6 100644 --- a/lib/ipmi_dcmi.c +++ b/lib/ipmi_dcmi.c @@ -1355,7 +1355,7 @@ ipmi_dcmi_prnt_discvry_snsr(struct ipmi_intf * intf, uint8_t isnsr) struct ipmi_rs * rsp; /* ipmi response */ uint8_t records = 0; int8_t instances = 0; - uint8_t offset = 0; + uint8_t offset = 1; uint16_t record_id = 0; uint8_t id_buff[16]; /* enough for 8 record IDs */ rsp = ipmi_dcmi_discvry_snsr(intf, isnsr, 0); ``` After this change, the sensor list continues from TEMP09 instead of repeating TEMP08. I can submit a pull request if this is considered the correct fix.
Sign in to join this conversation.
No Branch/Tag specified
master
bugfix/43-Fix-timezone-and-DST-in-SEL
pages
bugfix/fix-ci-builds
feature/refactor-sdr-name-handling
cleanup/nm
feature/add-support-for-boot-mailbox
codefactor
bugfix/26
IPMITOOL_1_8_19
IPMITOOL_1_8_18
IPMITOOL_1_8_17
IPMITOOL_1_8_16
IPMITOOL_1_8_15
IPMITOOL_1_8_15RC1
IPMITOOL_1_8_14
IPMITOOL_1_8_14RC2
IPMITOOL_1_8_14RC1
ipmitool
IPMITOOL_1_8_13
IPMITOOL_1_8_13RC1
IPMITOOL_1_8_12
IPMITOOL_1_8_9
IPMITOOL_1_8_8
IPMITOOL_1_8_7
IPMITOOL_1_8_6
IPMITOOL_1_8_5
IPMITOOL_1_8_0
IPMITOOL_S10_U1
IPMITOOL_1_6_1
IPMITOOL_1_6_0
IPMITOOL_1_5_9
IPMITOOL_1_5_8
IPMITOOL_1_5_7
IPMITOOL_1_5_6
IPMITOOL_1_5_4
IPMITOOL_1_4_1_1
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IPMITool/ipmitool#87
Reference in a new issue
IPMITool/ipmitool
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?