Ban by /64 by default instead of /128

This commit is contained in:
Gustaf Alhäll 2024-11-03 18:06:05 +01:00
parent 987d2ee59a
commit 4468219d7c

View file

@ -1273,7 +1273,7 @@ static boolean SOCK_Ban(INT32 node)
else if (banned[numbans].any.sa_family == AF_INET6) else if (banned[numbans].any.sa_family == AF_INET6)
{ {
banned[numbans].ip6.sin6_port = 0; banned[numbans].ip6.sin6_port = 0;
bannedmask[numbans] = 128; bannedmask[numbans] = 64;
} }
#endif #endif
numbans++; numbans++;
@ -1310,7 +1310,7 @@ static boolean SOCK_SetBanAddress(const char *address, const char *mask)
bannedmask[numbans] = (UINT8)atoi(mask); bannedmask[numbans] = (UINT8)atoi(mask);
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
else if (runp->ai_family == AF_INET6) else if (runp->ai_family == AF_INET6)
bannedmask[numbans] = 128; bannedmask[numbans] = 64;
#endif #endif
else else
bannedmask[numbans] = 32; bannedmask[numbans] = 32;
@ -1319,7 +1319,7 @@ static boolean SOCK_SetBanAddress(const char *address, const char *mask)
bannedmask[numbans] = 32; bannedmask[numbans] = 32;
#ifdef HAVE_IPV6 #ifdef HAVE_IPV6
else if (bannedmask[numbans] > 128 && runp->ai_family == AF_INET6) else if (bannedmask[numbans] > 128 && runp->ai_family == AF_INET6)
bannedmask[numbans] = 128; bannedmask[numbans] = 64;
#endif #endif
numbans++; numbans++;
runp = runp->ai_next; runp = runp->ai_next;