Skip to content

Commit

Permalink
fix #60, no more log invalid packet, can be changed the log-malformed…
Browse files Browse the repository at this point in the history
… option
  • Loading branch information
dmachard committed Apr 13, 2022
1 parent 12e7433 commit 2562fe1
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions subprocessors/dnstapreader.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func (c *DnstapProcessor) LogInfo(msg string, v ...interface{}) {
}

func (c *DnstapProcessor) LogError(msg string, v ...interface{}) {
c.logger.Error("procesor dnstap parser - "+msg, v...)
c.logger.Error("processor dnstap parser - "+msg, v...)
}

func (d *DnstapProcessor) GetChannel() chan []byte {
Expand Down Expand Up @@ -214,12 +214,10 @@ func (d *DnstapProcessor) Run(sendTo []chan dnsutils.DnsMessage) {
}

if err = decodePayload(&dm, &dnsHeader, d.config); err != nil {
d.LogError("%v - %v", err, dm)
}

if dm.DNS.MalformedPacket == 1 {
// decoding error
if d.config.Trace.LogMalformed {
d.LogInfo("payload: %v", dm.DNS.Payload)
d.LogError("%v - %v", err, dm)
d.LogError("dump invalid dns payload: %v", dm.DNS.Payload)
}
}

Expand Down

0 comments on commit 2562fe1

Please sign in to comment.