Merge branch 'next' into gametype-refactor-1

This commit is contained in:
Lactozilla 2024-01-16 22:46:20 -03:00
commit d5791044a2

View file

@ -424,7 +424,7 @@ static boolean SOCK_cmpipv6(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
{ {
UINT8 bitmask; UINT8 bitmask;
I_Assert(mask <= 128); I_Assert(mask <= 128);
if (memcmp(&a->ip6.sin6_addr, &b->ip6.sin6_addr, mask / 8) != 0) if (memcmp(&a->ip6.sin6_addr.s6_addr, &b->ip6.sin6_addr.s6_addr, mask / 8) != 0)
return false; return false;
if (mask % 8 == 0) if (mask % 8 == 0)
return true; return true;
@ -437,6 +437,9 @@ static boolean SOCK_cmpaddr(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
{ {
UINT32 bitmask = INADDR_NONE; UINT32 bitmask = INADDR_NONE;
if (a->any.sa_family != b->any.sa_family)
return false;
if (mask && mask < 32) if (mask && mask < 32)
bitmask = htonl((UINT32)(-1) << (32 - mask)); bitmask = htonl((UINT32)(-1) << (32 - mask));