Skip to content

enhancement(stdlib): add IPv4-mapped IPv6 support to ip_cidr_contains#1614

Open
milas wants to merge 1 commit intovectordotdev:mainfrom
realm-security:milas/ip-cidr-mapped
Open

enhancement(stdlib): add IPv4-mapped IPv6 support to ip_cidr_contains#1614
milas wants to merge 1 commit intovectordotdev:mainfrom
realm-security:milas/ip-cidr-mapped

Conversation

@milas
Copy link

@milas milas commented Jan 27, 2026

Summary

Support IPv4-mapped IPv6 addresses/ranges with ip_cidr_contains.

Example of an IPv4-mapped IPv6 address: ::ffff:192.168.1.1.

2.5.5.2. IPv4-Mapped IPv6 Address

A second type of IPv6 address that holds an embedded IPv4 address is
defined. This address type is used to represent the addresses of
IPv4 nodes as IPv6 addresses. The format of the "IPv4-mapped IPv6
address" is as follows:

80 bits 16 bits 32 bits
0000..............................0000 FFFF IPv4 address

See [RFC4038] for background on the usage of the "IPv4-mapped IPv6 address".

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

Existing + new unit test cases.

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on
    our guidelines.
  • No. A maintainer will apply the "no-changelog" label to this PR.

(will add changelog entry after initial review / feedback)

Checklist

  • Our CONTRIBUTING.md is a good starting place.
  • (N/A) If this PR introduces changes to LICENSE-3rdparty.csv, please
    run dd-rust-license-tool write and commit the changes. More details here.
  • For new VRL functions, please also create a sibling PR in Vector to document the new function.

I'm happy to open Vector PR later with additional examples/prose for the new cases.

References

I did not find any open issues/PRs for this already, sorry if I missed one!

@milas milas requested a review from a team as a code owner January 27, 2026 15:59
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.

1 participant