From: havoc Date: Thu, 1 Apr 2004 22:07:23 +0000 (+0000) Subject: now uses getsockname to find out what address/port a newly opened socket is at, so... X-Git-Tag: xonotic-v0.1.0preview~5948 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=b3f70570d13813f6243f5aa1f92cd49fc7a75c12;p=xonotic%2Fdarkplaces.git now uses getsockname to find out what address/port a newly opened socket is at, so it won't say 0.0.0.0:0 anymore git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4072 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/lhnet.c b/lhnet.c index 58033bac..267dc462 100644 --- a/lhnet.c +++ b/lhnet.c @@ -459,6 +459,7 @@ lhnetsocket_t *LHNET_OpenSocket_Connectionless(lhnetaddress_t *address) { if (bind(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, address->addresstype == LHNETADDRESSTYPE_INET6 ? sizeof(lhnetsocket->address.addressdata.inet6) : sizeof(lhnetsocket->address.addressdata.inet4)) != -1) { + getsockname(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, address->addresstype == LHNETADDRESSTYPE_INET6 ? sizeof(lhnetsocket->address.addressdata.inet6) : sizeof(lhnetsocket->address.addressdata.inet4)); lhnetsocket->next = &lhnet_socketlist; lhnetsocket->prev = lhnetsocket->next->prev; lhnetsocket->next->prev = lhnetsocket;