Skip to content

lookup4 can reuse an IPv6-only resolver after lookup6 #6098

@shblue21

Description

@shblue21

Version

5.x

Context

DnsClientImpl keeps separate resolver caches for lookup(), lookup4(), and lookup6().

Resolver lookup uses the requested address type, but newly created resolvers are always stored in the IPv4 resolver cache.

As a result, lookup6() can create an IPv6-only resolver and store it in the IPv4 cache for the event loop. A later lookup4() call on the same event loop may then reuse that IPv6-only resolver instead of an IPv4-only resolver.

lookup4() should always use an IPv4-only resolver, even if lookup6() was called first.

Steps to reproduce

  1. Configure a DnsClient with a DNS server that returns both A and AAAA records for the same name.
  2. Call lookup6(name).
  3. From the same Vert.x context, call lookup4(name).

lookup4() may reuse the resolver created by lookup6() and return the IPv6 result instead of the A record.

Do you have a reproducer?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions