diff --git a/collectors/dnssniffer_processor.go b/collectors/dnssniffer_processor.go index e3763777..32303a87 100644 --- a/collectors/dnssniffer_processor.go +++ b/collectors/dnssniffer_processor.go @@ -130,7 +130,7 @@ func (d *DnsProcessor) Run(sendTo []chan dnsutils.DnsMessage) { d.LogError("%v - %v", err, dm) } - if dm.DNS.MalformedPacket == true { + if dm.DNS.MalformedPacket { if d.config.Global.Trace.LogMalformed { d.LogInfo("payload: %v", dm.DNS.Payload) } @@ -139,7 +139,7 @@ func (d *DnsProcessor) Run(sendTo []chan dnsutils.DnsMessage) { // compute latency if possible if d.config.Collectors.DnsSniffer.CacheSupport { queryport, _ := strconv.Atoi(dm.NetworkInfo.QueryPort) - if len(dm.NetworkInfo.QueryIp) > 0 && queryport > 0 && dm.DNS.MalformedPacket == false { + if len(dm.NetworkInfo.QueryIp) > 0 && queryport > 0 && !dm.DNS.MalformedPacket { // compute the hash of the query hash_data := []string{dm.NetworkInfo.QueryIp, dm.NetworkInfo.QueryPort, strconv.Itoa(dm.DNS.Id)} diff --git a/collectors/dnstap_processor.go b/collectors/dnstap_processor.go index f3167799..160d6763 100644 --- a/collectors/dnstap_processor.go +++ b/collectors/dnstap_processor.go @@ -228,7 +228,7 @@ func (d *DnstapProcessor) Run(sendTo []chan dnsutils.DnsMessage) { // compute latency if possible if d.config.Collectors.Dnstap.CacheSupport { - if len(dm.NetworkInfo.QueryIp) > 0 && queryport > 0 && dm.DNS.MalformedPacket == false { + if len(dm.NetworkInfo.QueryIp) > 0 && queryport > 0 && !dm.DNS.MalformedPacket { // compute the hash of the query hash_data := []string{dm.NetworkInfo.QueryIp, dm.NetworkInfo.QueryPort, strconv.Itoa(dm.DNS.Id)}