Merge branch 'fix-host-unreach-crash' into 'next'

Fix crash when trying to send to an unreachable client

See merge request STJr/SRB2!2232
This commit is contained in:
Logan Aerl Arias 2023-12-25 23:55:20 +00:00
commit 5c12707250

View file

@ -83,6 +83,10 @@
#undef ETIMEDOUT
#endif
#define ETIMEDOUT WSAETIMEDOUT
#ifdef EHOSTUNREACH
#undef EHOSTUNREACH
#endif
#define EHOSTUNREACH WSAEHOSTUNREACH
#ifndef IOC_VENDOR
#define IOC_VENDOR 0x18000000
#endif
@ -692,7 +696,7 @@ static void SOCK_Send(void)
if (c == ERRSOCKET)
{
int e = errno; // save error code so it can't be modified later
if (e != ECONNREFUSED && e != EWOULDBLOCK)
if (e != ECONNREFUSED && e != EWOULDBLOCK && e != EHOSTUNREACH)
I_Error("SOCK_Send, error sending to node %d (%s) #%u: %s", doomcom->remotenode,
SOCK_GetNodeAddress(doomcom->remotenode), e, strerror(e));
}