]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
make IPv6 addresses actually work in server queries
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 3 Oct 2010 13:59:19 +0000 (13:59 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Sun, 3 Oct 2010 14:17:28 +0000 (16:17 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10511 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=a99f9360b7301b2cde94d176b450fc708f50d5d1

netconn.c

index f8d3a39d7c28f430194fa0a3a0b153c598ab3af0..f6e5a6f3d8124b2b8c4673318f78f32e5cf2c79a 100755 (executable)
--- 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);
                                }
                        }