Skip to content

Fix port collision on IPv6 connections

Hanicef requested to merge Hanicef/SRB2:fix-ipv6-port-collision into master

When IPv6 was originally fixed, one of the fatal bugs that was involved in this was that addresses was incorrectly checked when comparing addresses, which completely broke stuff like banning. However, the fix was not fully implemented, since it was lacking one edge case that is used when connecting to servers: the mask being 0. That's apparently a special case where it should be treated as 32 or 128 for IPv4 or IPv6, respectively, but the IPv6 case lacked this test, so when checking for new connections, it only compared the port and would cause connection issues if two clients connecting over IPv6 had assigned the same port.

This patch implements this case so IPv6 connections will handle two clients with the same port as it should.

Merge request reports

Loading