little-big endian issue

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/networking@13126 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
hilnius 2013-07-08 15:57:46 +00:00
parent ac6534615c
commit 39436d464c

View File

@ -62,8 +62,13 @@ void GetPeerAddress::update()
if (rec_success == "yes")
{
TransportAddress* addr = static_cast<TransportAddress*>(m_callback_object);
result->get("ip", &addr->ip);
uint32_t reversed_ip;
result->get("ip", &reversed_ip);
result->get("port", &addr->port);
addr->ip = (((reversed_ip<<24)&0xff))
+( ((reversed_ip<<16)&0xff)>>8)
+( ((reversed_ip<<8)&0xff)>>16)
+( ((reversed_ip<<0)&0xff)>>24);
Log::info("GetPeerAddress", "Address gotten successfully.");
}
else