Skip to content

Commit

Permalink
- rewrites: fix invalid question in response
Browse files Browse the repository at this point in the history
for a rule:

cname -> domain

with IP of 'domain' resolved by upstream
  • Loading branch information
szolin committed May 29, 2020
1 parent 72f253f commit 12cb2e1
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions dnsforward/handle_dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,11 @@ func processFilteringAfterResponse(ctx *dnsContext) int {

switch res.Reason {
case dnsfilter.ReasonRewrite:
if d.Res != nil {
break // response is already prepared
}
if len(res.CanonName) == 0 {
if len(ctx.origQuestion.Name) == 0 {
// origQuestion is set in case we get only CNAME without IP from rewrites table
break
}

d.Req.Question[0] = ctx.origQuestion
d.Res.Question[0] = ctx.origQuestion

Expand Down

0 comments on commit 12cb2e1

Please sign in to comment.