Prevent default cmdGetDeviceSdr handler registration in dynamic sensors
Signed-off-by: Vivekanand Veeracholan <vveerach@google.com>
Change-Id: Iedfa2e1983137afd032c05df07ab5d4a5f09fae9
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 5464d0e..fcfd428 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -1506,6 +1506,11 @@
ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnSensor,
ipmi::sensor_event::cmdSetSensorThreshold,
ipmi::Privilege::User, ipmiSenSetSensorThresholds);
+
+ // <Get Device SDR>
+ ipmi_register_callback(NETFUN_SENSOR, IPMI_CMD_GET_DEVICE_SDR, nullptr,
+ ipmi_sen_get_sdr, PRIVILEGE_USER);
+
#endif
// Common Handers used by both implementation.
@@ -1519,8 +1524,5 @@
ipmi::sensor_event::cmdGetSensorType,
ipmi::Privilege::User, ipmiGetSensorType);
- // <Get Device SDR>
- ipmi_register_callback(NETFUN_SENSOR, IPMI_CMD_GET_DEVICE_SDR, nullptr,
- ipmi_sen_get_sdr, PRIVILEGE_USER);
return;
}