]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
LHNET now enables broadcast send/receive on any UDP ports it opens
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 15 Mar 2005 00:09:07 +0000 (00:09 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 15 Mar 2005 00:09:07 +0000 (00:09 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5085 d7cf8633-e32d-0410-b094-e92efae38249

lhnet.c

diff --git a/lhnet.c b/lhnet.c
index a8c88a9930a15b6cb49d9722ba691dc9982823d4..8c9c845562355afcd9700d09b0ff12dc77d69510 100644 (file)
--- 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;