Add (indirect) to the logged pattern for indirect blocks
This commit is contained in:
parent
21c63a5608
commit
57a88eda56
|
@ -24,9 +24,12 @@ const aliasesLimit = 8
|
|||
|
||||
var blockedNames *BlockedNames
|
||||
|
||||
func (blockedNames *BlockedNames) check(pluginsState *PluginsState, qName string) (bool, error) {
|
||||
func (blockedNames *BlockedNames) check(pluginsState *PluginsState, qName string, indirect bool) (bool, error) {
|
||||
qName = strings.ToLower(StripTrailingDot(qName))
|
||||
reject, reason, xweeklyRanges := blockedNames.patternMatcher.Eval(qName)
|
||||
if indirect {
|
||||
reason = reason + " (indirect)"
|
||||
}
|
||||
var weeklyRanges *WeeklyRanges
|
||||
if xweeklyRanges != nil {
|
||||
weeklyRanges = xweeklyRanges.(*WeeklyRanges)
|
||||
|
@ -145,7 +148,7 @@ func (plugin *PluginBlockName) Eval(pluginsState *PluginsState, msg *dns.Msg) er
|
|||
if len(questions) != 1 {
|
||||
return nil
|
||||
}
|
||||
_, err := blockedNames.check(pluginsState, questions[0].Name)
|
||||
_, err := blockedNames.check(pluginsState, questions[0].Name, false)
|
||||
return err
|
||||
}
|
||||
|
||||
|
@ -185,7 +188,7 @@ func (plugin *PluginBlockNameResponse) Eval(pluginsState *PluginsState, msg *dns
|
|||
if header.Class != dns.ClassINET || header.Rrtype != dns.TypeCNAME {
|
||||
continue
|
||||
}
|
||||
if blocked, err := blockedNames.check(pluginsState, answer.(*dns.CNAME).Target); blocked || err != nil {
|
||||
if blocked, err := blockedNames.check(pluginsState, answer.(*dns.CNAME).Target, true); blocked || err != nil {
|
||||
return err
|
||||
}
|
||||
aliasesLeft--
|
||||
|
|
Loading…
Reference in New Issue