fix: declare ipv6Handler as dns.Handler to match wrapIPv6Handler return type

The handler variable is dns.HandlerFunc but wrapIPv6Handler returns
dns.Handler (interface). Go's type inference picked dns.HandlerFunc
for ipv6Handler, causing a compile error on assignment. Explicit
type declaration fixes the mismatch.
This commit is contained in:
Codescribe
2026-03-30 19:49:21 -04:00
committed by Cuong Manh Le
parent 22a796f673
commit c55e2a722c

View File

@@ -211,7 +211,7 @@ func (p *prog) serveDNS(listenerNum string) error {
proto := proto
if needLocalIPv6Listener(p.cfg.Service.InterceptMode) {
g.Go(func() error {
ipv6Handler := handler
var ipv6Handler dns.Handler = handler
if proto == "udp" {
ipv6Handler = wrapIPv6Handler(handler)
}