From 6158af1858f8a88193a48f1b44ba0de03dfbdaf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Wed, 5 Feb 2025 09:17:29 +0800 Subject: [PATCH] Fix dns router crash --- dns/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dns/router.go b/dns/router.go index 0e87c99a..1a0e3031 100644 --- a/dns/router.go +++ b/dns/router.go @@ -301,7 +301,7 @@ func (r *Router) Exchange(ctx context.Context, message *mDNS.Msg, options adapte return nil, err } if r.dnsReverseMapping != nil && len(message.Question) > 0 && response != nil && len(response.Answer) > 0 { - if transport.Type() != C.DNSTypeFakeIP { + if transport == nil || transport.Type() != C.DNSTypeFakeIP { for _, answer := range response.Answer { switch record := answer.(type) { case *mDNS.A: