Skip to content

Fix is_valid_ip_address() to handle incorrect paddings#99624

Closed
MarcusPaulsson wants to merge 1 commit into
godotengine:masterfrom
MarcusPaulsson:issue_branch_4
Closed

Fix is_valid_ip_address() to handle incorrect paddings#99624
MarcusPaulsson wants to merge 1 commit into
godotengine:masterfrom
MarcusPaulsson:issue_branch_4

Conversation

@MarcusPaulsson
Copy link
Copy Markdown

Proposal to Fix Inconsistent Behavior in is_valid_ip_address() for IPv6 Addresses with Multiple ::
Fixes: #99623

This pull request resolves inconsistent behavior in the is_valid_ip_address() method when validating IPv6 addresses. Specifically, it addresses the following issues:

Old behavior:
issue_image

New behavior:
fixed_issue_image

The updated is_valid_ip_address() method tracks :: with double_colon_index, ensuring only one occurrence. It validates segment counts, handles compressed zeros logically, and strictly enforces IPv4-mapped segments in the final position.

@MarcusPaulsson MarcusPaulsson requested a review from a team as a code owner November 24, 2024 12:07
@AThousandShips AThousandShips changed the title Fixes is_valid_ip_address() to handle incorrect paddings Fix is_valid_ip_address() to handle incorrect paddings Nov 24, 2024
@AThousandShips AThousandShips requested a review from a team November 24, 2024 12:08
@AThousandShips AThousandShips added cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Nov 24, 2024
@AThousandShips AThousandShips added this to the 4.4 milestone Nov 24, 2024
Your meaningful commit message

clang_format
@RedMser
Copy link
Copy Markdown
Contributor

RedMser commented Nov 24, 2024

This seems like a good opportunity to bring your test suite into the unit tests of the engine: https://github.com/godotengine/godot/blob/0c45ace151f25de2ca54fe7a46b6f077be32ba6f/tests/core/string/test_string.h

Should likely be done as a separate PR after this one.

@Repiteo Repiteo added the cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release label Feb 24, 2025
@Repiteo Repiteo modified the milestones: 4.4, 4.5 Feb 24, 2025
@akien-mga akien-mga removed the cherrypick:4.2 Considered for cherry-picking into a future 4.2.x release label Mar 5, 2025
@Repiteo Repiteo added the cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release label Sep 5, 2025
@Repiteo Repiteo modified the milestones: 4.5, 4.6 Sep 5, 2025
@akien-mga
Copy link
Copy Markdown
Member

Superseded by #114827. Thanks for the contribution!

@akien-mga akien-mga closed this Jan 13, 2026
@akien-mga akien-mga added archived and removed cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Jan 13, 2026
@akien-mga akien-mga removed this from the 4.6 milestone Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect results for 'is_valid_ip_address()' for compressed IPv6 adresses using '::'

5 participants