Skip to content

IpRange wildcard prefix expansion uses ::/1 for IPv6 #170

@immanuwell

Description

@immanuwell

IpRange::Wildcard.iter_prefixes() looks like it under-covers IPv6.

Wildcard.contains() matches all IP addresses, but iter_prefixes() currently returns ::/1 for IPv6. For wildcard expansion, I think this should be ::/0, otherwise only half the IPv6 space is covered.

Repro:

let pfxs = IpRange::Wildcard.iter_prefixes().collect::<Vec<_>>();
assert_eq!(pfxs[1], "::/0".parse()?);

I have a tiny fix plus regression test here:
main...immanuwell:fix-iprange-wildcard-ipv6

I could not open a PR because the repo currently limits PRs to collaborators. Would you be open to taking this patch?

Created using Codex

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions