From: divverent Date: Sun, 3 Oct 2010 13:59:19 +0000 (+0000) Subject: make IPv6 addresses actually work in server queries X-Git-Tag: xonotic-v0.1.0preview~56^2~106 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a99f9360b7301b2cde94d176b450fc708f50d5d1;p=xonotic%2Fdarkplaces.git make IPv6 addresses actually work in server queries git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10511 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/netconn.c b/netconn.c index f8d3a39d..f6e5a6f3 100755 --- a/netconn.c +++ b/netconn.c @@ -1531,16 +1531,16 @@ static void NetConn_ClientParsePacket_ServerList_ParseDPList(lhnetaddress_t *sen ifname = LHNETADDRESS_GetInterfaceName(senderaddress); if (ifname != NULL) { - dpsnprintf (ipstring, sizeof (ipstring), "[%x%02x:%x%02x:%x%02x:%x%02x:%x%02x:%x%02x:%x%02x:%x%02x%%%s]:%hu", - data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], - data[9], data[10], data[11], data[12], data[13], data[14], data[15], data[16], + dpsnprintf (ipstring, sizeof (ipstring), "[%x:%x:%x:%x:%x:%x:%x:%x%%%s]:%hu", + (data[1] << 8) | data[2], (data[3] << 8) | data[4], (data[5] << 8) | data[6], (data[7] << 8) | data[8], + (data[9] << 8) | data[10], (data[11] << 8) | data[12], (data[13] << 8) | data[14], (data[15] << 8) | data[16], ifname, port); } else { - dpsnprintf (ipstring, sizeof (ipstring), "[%x%02x:%x%02x:%x%02x:%x%02x:%x%02x:%x%02x:%x%02x:%x%02x]:%hu", - data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], - data[9], data[10], data[11], data[12], data[13], data[14], data[15], data[16], + dpsnprintf (ipstring, sizeof (ipstring), "[%x:%x:%x:%x:%x:%x:%x:%x]:%hu", + (data[1] << 8) | data[2], (data[3] << 8) | data[4], (data[5] << 8) | data[6], (data[7] << 8) | data[8], + (data[9] << 8) | data[10], (data[11] << 8) | data[12], (data[13] << 8) | data[14], (data[15] << 8) | data[16], port); } }