Fix: fix the access to sin/sin6_addr in getRemoteAddress
inet_ntop using 'remoteSockAddr' instead of casting it to 'sockaddr_in/in6'
structure and getting the field 'sin/sin6_addr' access. As result of this
'getRemoteAddress' returns junk from top of the 'sockaddr_storage' structure.
Tested: Verified by calling 'getRemoteAddress' inside net-ipmi lambda
handler.
[handler, this](const boost::system::error_code& ec,
const IpmiDbusRspType& response) {
...
std::string raddr =
handler->getChannel()->getRemoteAddress();
some_func_for_put_addr(raddr);
...
}
Signed-off-by: Ivan Mikhaylov <i.mikhaylov@yadro.com>
Change-Id: Ia8ae2763a2ab372c148323974fe33ac44b1d28f0
1 file changed