From 3cf48e31d6efb04dc5f9cd6c0128e3a715530df7 Mon Sep 17 00:00:00 2001 From: Hanicef Date: Thu, 7 Nov 2024 19:23:34 +0000 Subject: [PATCH] Fix netcode on Haiku --- src/netcode/i_tcp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/netcode/i_tcp.c b/src/netcode/i_tcp.c index ed1f5b4e7..442ed9817 100644 --- a/src/netcode/i_tcp.c +++ b/src/netcode/i_tcp.c @@ -1211,11 +1211,16 @@ static SINT8 SOCK_NetMakeNodewPort(const char *address, const char *port) // test ip address of server for (i = 0; i < mysocketses; ++i) { +#ifdef __HAIKU__ + // Haiku doesn't appreciate empty packets, so just hope for the best. + if (runp->ai_addr->sa_family == myfamily[i]) +#else /* sendto tests that there is a network to this address */ if (runp->ai_addr->sa_family == myfamily[i] && sendto(mysockets[i], NULL, 0, 0, runp->ai_addr, runp->ai_addrlen) == 0) +#endif { memcpy(&clientaddress[newnode], runp->ai_addr, runp->ai_addrlen); break;