plugin/dnstap: Fix behavior when multiple dnstap plugins specified (#5773)

* fix multiple dnstap plugins behavior

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
Chris O'Haver 2022-11-28 10:33:31 -05:00 committed by GitHub
parent c4dd9d50f1
commit 04a30198c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 220 additions and 121 deletions

View file

@ -49,7 +49,7 @@ type Forward struct {
// the maximum allowed (maxConcurrent)
ErrLimitExceeded error
tapPlugin *dnstap.Dnstap // when the dnstap plugin is loaded, we use to this to send messages out.
tapPlugins []*dnstap.Dnstap // when dnstap plugins are loaded, we use to this to send messages out.
Next plugin.Handler
}
@ -150,7 +150,7 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
child.Finish()
}
if f.tapPlugin != nil {
if len(f.tapPlugins) != 0 {
toDnstap(f, proxy.addr, state, opts, ret, start)
}