Skip to content

Reject compressed IPv6 addresses with too many groups - #77

Open
omrzk wants to merge 1 commit into
krisprice:masterfrom
omrzk:fix/ipv6-compressed-group-limit-50
Open

omrzk wants to merge 1 commit into
krisprice:masterfrom
omrzk:fix/ipv6-compressed-group-limit-50

Conversation

@omrzk

@omrzk omrzk commented Nov 2, 2026

Copy link
Copy Markdown

:: must represent at least one zero group, but the IPv6 parser currently allows eight explicit groups in addition to the compression marker. Reserve that group when reading the suffix, including when an embedded IPv4 address supplies the final two groups.

Fixes #50.

The regressions compare Ipv6Net and IpNet against std::net::Ipv6Addr with every compression position, boundary group counts, and prefixes 0/64/128. They also cover embedded IPv4 tails and human-readable Serde deserialization. All three fail on unchanged master and pass with the fix.

Validation: cargo test --all-features (37 unit tests, 3 regressions, 56 doctests), default/no-default-feature tests, all-feature release tests, build and docs pass. Clippy completes with the same existing warnings as clean master. The new test file passes rustfmt; repository-wide formatting still fails on existing formatting differences also present on clean master.

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.

String Representations of Ipv6Net allow more than 8 groups

1 participant