X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=lhnet.c;h=8c9c845562355afcd9700d09b0ff12dc77d69510;hb=2eb9ff90d49e3954fc2adb23ea0c643e40ec7b09;hp=a8c88a9930a15b6cb49d9722ba691dc9982823d4;hpb=2de6d1f46d005bdf64c115049b0ffb9246df309d;p=xonotic%2Fdarkplaces.git diff --git a/lhnet.c b/lhnet.c index a8c88a99..8c9c8455 100644 --- a/lhnet.c +++ b/lhnet.c @@ -467,7 +467,10 @@ lhnetsocket_t *LHNET_OpenSocket_Connectionless(lhnetaddress_t *address) namelen = address->addresstype == LHNETADDRESSTYPE_INET6 ? sizeof(lhnetsocket->address.addressdata.inet6) : sizeof(lhnetsocket->address.addressdata.inet4); if (bind(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, namelen) != -1) { + int i = 1; getsockname(lhnetsocket->inetsocket, (void *)&lhnetsocket->address.addressdata, &namelen); + // enable broadcast on this socket + setsockopt(lhnetsocket->inetsocket, SOL_SOCKET, SO_BROADCAST, (char *)&i, sizeof(i)); lhnetsocket->next = &lhnet_socketlist; lhnetsocket->prev = lhnetsocket->next->prev; lhnetsocket->next->prev = lhnetsocket;