apphandler: Fix for total session slots count
Issue: Get session info shows 60 sessions as total number of sessions
for all medium_type as lan-802 channels instead actual sessions.
Fix: Initialize the channel Info structure to empty to avoid wrong
calculation of total number of session slots for all channels
which are having medium_type as lan-802.
Tested:
Verified using ipmitool command.
Before:
Command: ipmitool -I lanplus -H <BMC-IP> -C 17 -U root -P <Password> session info all
Response:
session handle : 129
slot count : 60
active sessions : 1
user id : 1
privilege level : ADMINISTRATOR
session type : IPMIv2/RMCP+
channel number : 0x03
console ip : 10.190.201.113
console mac : 00:00:00:00:00:00
console port : 42963
After:
Command: ipmitool -I lanplus -H <BMC-IP> -C 17 -U root -P <Password> session info all
Response:
session handle : 129
slot count : 30
active sessions : 1
user id : 1
privilege level : ADMINISTRATOR
session type : IPMIv2/RMCP+
channel number : 0x03
console ip : 10.190.201.113
console mac : 00:00:00:00:00:00
console port : 48994
Signed-off-by: Jayaprakash Mutyala <mutyalax.jayaprakash@intel.com>
Change-Id: I9a4523bfbaeb0178f15e8b40f034b43d7ce4b8a0
diff --git a/apphandler.cpp b/apphandler.cpp
index 8baff39..4ba637f 100644
--- a/apphandler.cpp
+++ b/apphandler.cpp
@@ -944,7 +944,7 @@
while (ch < ipmi::maxIpmiChannels &&
count < session::maxNetworkInstanceSupported)
{
- ipmi::ChannelInfo chInfo;
+ ipmi::ChannelInfo chInfo{};
ipmi::getChannelInfo(ch, chInfo);
if (static_cast<ipmi::EChannelMediumType>(chInfo.mediumType) ==
ipmi::EChannelMediumType::lan8032)