From 279425b17c312e5d22818ec1f882b186bd84e3c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Fri, 10 Oct 2025 15:16:34 +0800 Subject: [PATCH] Fix DNS reject panic --- dns/router.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/dns/router.go b/dns/router.go index e62f0ef51..ae9e68c7e 100644 --- a/dns/router.go +++ b/dns/router.go @@ -386,12 +386,7 @@ func (r *Router) Lookup(ctx context.Context, domain string, options adapter.DNSQ if rule != nil { switch action := rule.Action().(type) { case *R.RuleActionReject: - switch action.Method { - case C.RuleActionRejectMethodDefault: - return nil, nil - case C.RuleActionRejectMethodDrop: - return nil, tun.ErrDrop - } + return nil, &R.RejectedError{Cause: action.Error(ctx)} case *R.RuleActionPredefined: if action.Rcode != mDNS.RcodeSuccess { err = RcodeError(action.Rcode)