Use pre-authorized ports for dns queries, improve logging

This commit is contained in:
Daniel
2019-05-10 11:56:50 +02:00
parent 9fcfd34f28
commit 55ef385dcb
8 changed files with 154 additions and 98 deletions

View File

@@ -3,6 +3,7 @@
package intel
import (
"context"
"errors"
"fmt"
"net"
@@ -262,7 +263,9 @@ func listenForDNSPackets(conn *net.UDPConn, messages chan *dns.Msg) {
}
}
func queryMulticastDNS(fqdn string, qtype dns.Type) (*RRCache, error) {
func queryMulticastDNS(ctx context.Context, fqdn string, qtype dns.Type) (*RRCache, error) {
log.Tracer(ctx).Trace("intel: resolving with mDNS")
q := new(dns.Msg)
q.SetQuestion(fqdn, uint16(qtype))
// request unicast response