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
- Configure a
DnsClient with a DNS server that returns both A and AAAA records for the same name.
- Call
lookup6(name).
- 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?
Version
5.x
Context
DnsClientImplkeeps separate resolver caches forlookup(),lookup4(), andlookup6().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 laterlookup4()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 iflookup6()was called first.Steps to reproduce
DnsClientwith a DNS server that returns both A and AAAA records for the same name.lookup6(name).lookup4(name).lookup4()may reuse the resolver created bylookup6()and return the IPv6 result instead of the A record.Do you have a reproducer?