Skip to content
Snippets Groups Projects

Fix connecting to localhost on non-standard ports

Merged Hanicef requested to merge Hanicef/SRB2Classic:fix-localhost-nonstandard-port into next

When connecting to a dotless domain (localhost, for example), the connection would fail if the server was hosted on a non-standard port, even if you explicitly specify the correct port. The cause of this is due to a bad check inside I_NetSplitAddress which checks for dots instead of the brackets that IPv6 uses. On dotless domains, though, there are no dots, and as such, it will incorrectly treat it as an IPv6 address and ultimately fail to determine the port component of the address.

This patch fixes it by just checking for the brackets instead, since those are required for an IPv6 address and exists specifically to solve this exact problem.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading