Add wildcard name support for predefined records

This commit is contained in:
世界 2025-03-18 19:17:11 +08:00
parent b2f456d6c5
commit 45ebaabcd7
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
2 changed files with 30 additions and 14 deletions

View file

@ -263,20 +263,7 @@ func (r *Router) Exchange(ctx context.Context, message *mDNS.Msg, options adapte
return nil, tun.ErrDrop
}
case *R.RuleActionPredefined:
return &mDNS.Msg{
MsgHdr: mDNS.MsgHdr{
Id: message.Id,
Response: true,
Authoritative: true,
RecursionDesired: true,
RecursionAvailable: true,
Rcode: action.Rcode,
},
Question: message.Question,
Answer: action.Answer,
Ns: action.Ns,
Extra: action.Extra,
}, nil
return action.Response(message), nil
}
}
var responseCheck func(responseAddrs []netip.Addr) bool