net_ipmi: initialize ipmiNetworkInstance to zero as default value
Close session failed like
```
Close Session command failed: Unspecified error
```
due to using `closeOtherNetInstanceSession` instead of
`closeMyNetInstanceSession`.
After initializing ipmiNetworkInstance to zero by default, the issue is
resolved.
Tested:
Ran the following multiple times
```
for ((i=0; i<10; i++)); do
./ipmitool -I lanplus -H $IP_ADDRESS%usb0 \
-U root -P 0penBmc fru &
done
...
Before the change it will failed to close the session and run out of
available sessions.
For example,
```
Close Session command failed: Unspecified error
```
```
Error: Unable to establish IPMI v2 / RMCP+ session
```
After this change, no more errors and all close/create sessions are
successful.
Change-Id: Ibaf26fb2e554fa530542587b380891ee6f60ec0d
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/sessions_manager.hpp b/sessions_manager.hpp
index 14027db..5fefbcc 100644
--- a/sessions_manager.hpp
+++ b/sessions_manager.hpp
@@ -160,7 +160,7 @@
SessionMap sessionsMap;
std::unique_ptr<sdbusplus::server::manager::manager> objManager = nullptr;
std::string chName{}; // Channel Name
- uint8_t ipmiNetworkInstance;
+ uint8_t ipmiNetworkInstance = 0;
void setNetworkInstance(void);
};