fix(resolver): fix IPv4/IPv6 fallback asymmetry, data race, and caller mutation bugs
Normalize Only/Prefer values (ip4→ipv4, ip6→ipv6) so downstream comparisons match correctly. Fix asymmetric fallback where caller network=ip6 fell through to IPv4 but ip4 didn't fall through to IPv6 — both branches now check hard constraints (server.Only || callerPref) only, allowing soft Prefer to fall back. Fix data race on cache item.ts by reading it inside RLock. Fix Store mutating caller's dns.Msg by copying before TTL override. Add singleflight dedup, semaphore-bounded async refresh, DNS rcode error checking, and bump EDNS0 UDPSize to 4096. Add 25 tests.
This commit is contained in:
@@ -204,7 +204,7 @@ func (ex *exchanger) exchange(ctx context.Context, msg []byte) ([]byte, error) {
|
||||
}
|
||||
|
||||
conn := &dns.Conn{
|
||||
UDPSize: 1024,
|
||||
UDPSize: 4096,
|
||||
Conn: c,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user