Correct IPMI firmware revision report
OpenBMC currently uses firmware revision from the VERSION parameters
from /etc/os-release. While WebUI and Redfish uses entire string for
the revision, IPMI extracts major and minor numbers from that string.
However, phosphor-host-ipmd mistakenly converts the number to
hexa-decimal which make the mismatch between Redfish and IPMI.
This commit fixes the issue by updating the conversion to use decimal
number.
Tested:
1. Tag with v1.11.0001-ampere and check ipmitool mc info report
firmware revision to 1.11
Signed-off-by: Hieu Huynh <hieuh@os.amperecomputing.com>
Change-Id: I7340827dfc6de6664dde4b58e61197f81b4f89ca
diff --git a/apphandler.cpp b/apphandler.cpp
index a20d61a..9b76e7b 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -498,7 +498,7 @@
if (location != std::string::npos)
{
rev.major =
- static_cast<char>(std::stoi(s.substr(0, location), 0, 16));
+ static_cast<char>(std::stoi(s.substr(0, location), 0, 10));
token = s.substr(location + 1);
}
@@ -508,7 +508,7 @@
if (location != std::string::npos)
{
rev.minor = static_cast<char>(
- std::stoi(token.substr(0, location), 0, 16));
+ std::stoi(token.substr(0, location), 0, 10));
token = token.substr(location + 1);
}
}