From 5abb9797f0ccc130680350f6e227481962b107ed Mon Sep 17 00:00:00 2001 From: Denis MACHARD <5562930+dmachard@users.noreply.github.com> Date: Sat, 30 Jul 2022 10:28:39 +0200 Subject: [PATCH] Multiplex (#102) * More flexibility in the multiplexer configuration * add missing method in dnssniffer * fix test unit * Update README.md * take in account go-staticcheck * update config --- collectors/dnssniffer_processor.go | 4 ++-- collectors/dnstap_processor.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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)}