dns proxy: DNS64 synthesis for IPv6-only networks without CLAT

This commit is contained in:
Dev Scribe authored and Cuong Manh Le committed 2026-09-28 16:43:43 +07:00
1 parent ca27f60bc4
commit 9d724869e9
6 files changed
+965 -21

No files matched your search

+9
View File
@@ -29,6 +29,7 @@ type Key struct {
Name string
Upstream string
ECS string
Variant string
}
type Value struct {
@@ -71,6 +72,14 @@ func NewKey(msg *dns.Msg, upstream string) Key {
return Key{Qtype: q.Qtype, Qclass: q.Qclass, Name: normalizeQname(q.Name), Upstream: upstream, ECS: CanonicalECS(msg)}
}
// NewVariantKey creates a cache key in a named result variant. Variants keep
// derived answers separate from the upstream's answer to the same question.
func NewVariantKey(msg *dns.Msg, upstream, variant string) Key {
key := NewKey(msg, upstream)
key.Variant = variant
return key
}
// CanonicalECS returns a canonical string form of the EDNS Client Subnet (ECS,
// EDNS option 8) carried by msg, suitable for partitioning cache and
// singleflight keys. A request with no ECS option returns "", so all ECS-less