mojira.dev
MC-239815

"Server Address" field in handshake packet not padded correctly while user login with an IPv6 address

This issue only occurs while user login into a server, not on a status event.

Since 1.17.1-pre1, the server address padded in the handshake packet while login event is inconsistency with the exact content which user provided in the "server address" textbox, different from previous versions.

For example, if user provided "[::1]", in 1.17 and before, should padded "::1".

But, in 1.17.1-pre1 and later, it padded some address like "0:0:0:0:0:0:0:1". Obviously, the user provided address is resolved to numeric form, then resolved back to the string form.

Even worse, if user using a "fe80" address, the user's computer name will be padded.

Because this change, some reverse proxy server based on the server name will not normally functional.

Note: The packet content via Wireshark in different conditions are provided in screenshot files, for comparsion.

Steps to reproduce:

  1. Setup a dedicated server, listening on a IPv6 address.

  2. Starting packet capture using Wireshark (or other tools) on the port which the server listening on.

  3. Use "[::1]" (or other IPv6 address) to connect to that server.

  4. See that captured packet (the first packet send by the client, marked PSH).

Observed results:

"0:0:0:0:0:0:0:1" is padded.

Expected results:

"::1" is padded.

Attachments

Comments 1

Sending the exact string using IPv4. Couldn't verify it with IPv6, but the client is probably still trying to translate the address as in 1.16 😃

anterdc99

(Unassigned)

Plausible

Platform

Low

Networking

1.17.1, 21w42a, 21w43a, 21w44a, 1.18 Pre-release 1, ..., 23w05a, 23w06a, 23w07a, 1.19.4 Pre-release 2, 1.20.1

Retrieved