Skip to content

Fix validation of 0/8 IPv4 addresses - #580

Merged
rschmitt merged 1 commit into
apache:masterfrom
rschmitt:ipv4addr
Dec 5, 2025
Merged

Fix validation of 0/8 IPv4 addresses#580
rschmitt merged 1 commit into
apache:masterfrom
rschmitt:ipv4addr

Conversation

@rschmitt

@rschmitt rschmitt commented Dec 2, 2025

Copy link
Copy Markdown
Contributor

0.0.0.0/8 IPv4 addresses are not illegal, just "reserved." This change brings InetAddressUtils in line with the JDK's InetAddress implementation, which accepts these addresses without issue, e.g.:

    InetAddress.getByAddress(new byte[]{ 0, 10, 25, 68 });
    InetAddress.getByName("0.10.25.68");

0.0.0.0/8 IPv4 addresses are not illegal, just "reserved." This change
brings `InetAddressUtils` in line with the JDK's `InetAddress`
implementation, which accepts these addresses without issue, e.g.:

```java
    InetAddress.getByAddress(new byte[]{ 0, 10, 25, 68 });
    InetAddress.getByName("0.10.25.68");
```
@rschmitt
rschmitt merged commit cecaac5 into apache:master Dec 5, 2025
10 checks passed
@rschmitt
rschmitt deleted the ipv4addr branch December 5, 2025 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants