Skip to content

Commit

Permalink
return errors properly
Browse files Browse the repository at this point in the history
  • Loading branch information
kelchy committed Nov 22, 2021
1 parent a79872d commit a5aff9e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions matchrelay.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ func (mr *MatchRelay) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns
for i := len(sArr) - 2; i >= 0; i = i - 1 {
str := sArr[i] + "." + base
if _, ok := mr.domains[str]; ok {
mr.fwd.ServeDNS(ctx, w, r)
return 0, nil
return mr.fwd.ServeDNS(ctx, w, r)
}
base = str
}
Expand All @@ -82,9 +81,7 @@ func (mr *MatchRelay) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns
}
ipMatch := matchWithPolicies(rule.policies, w, r)
if ipMatch {
mr.fwd.ServeDNS(ctx, w, r)

return 0, nil
return mr.fwd.ServeDNS(ctx, w, r)
}
}
return plugin.NextOrFailure(state.Name(), mr.Next, ctx, w, r)
Expand Down

0 comments on commit a5aff9e

Please sign in to comment.