Skip to content

Commit

Permalink
Multiplex (#102)
Browse files Browse the repository at this point in the history
* More flexibility in the multiplexer configuration

* add missing method in dnssniffer

* fix test unit

* Update README.md

* take in account go-staticcheck

* update config
  • Loading branch information
dmachard authored Jul 30, 2022
1 parent 87203e2 commit 5abb979
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions collectors/dnssniffer_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand All @@ -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)}

Expand Down
2 changes: 1 addition & 1 deletion collectors/dnstap_processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)}

Expand Down

0 comments on commit 5abb979

Please sign in to comment.