diff --git a/probe/endpoint/dns_snooper_linux_amd64.go b/probe/endpoint/dns_snooper_linux_amd64.go index 11f5ce6b81..e4750d16c5 100644 --- a/probe/endpoint/dns_snooper_linux_amd64.go +++ b/probe/endpoint/dns_snooper_linux_amd64.go @@ -43,7 +43,6 @@ func NewDNSSnooper() (*DNSSnooper, error) { } func newPcapHandle() (*pcap.Handle, error) { - // TODO: use specific interfaces instead? inactive, err := pcap.NewInactiveHandle("any") if err != nil { return nil, err @@ -52,11 +51,6 @@ func newPcapHandle() (*pcap.Handle, error) { if err = inactive.SetPromisc(true); err != nil { return nil, err } - // TODO: reduce the size of packets being copied? maybe an overoptimization - // if err = inactive.SetSnapLen(snaplen); err != nil { - // return - // } - // pcap timeout blackmagic copied from Weave Net to reduce CPU consumption // see https://github.com/weaveworks/weave/commit/025315363d5ea8b8265f1b3ea800f24df2be51a4 if err = inactive.SetTimeout(time.Duration(math.MaxInt64)); err != nil { @@ -132,7 +126,7 @@ func (s *DNSSnooper) run() { sll layers.LinuxSLL ) - // assumes that the "any" interface in being used (see https://wiki.wireshark.org/SLL) + // assumes that the "any" interface is being used (see https://wiki.wireshark.org/SLL) packetParser := gopacket.NewDecodingLayerParser(layers.LayerTypeLinuxSLL, &sll, ð, &ip4, &ip6, &udp, &tcp, &dns) for { diff --git a/prog/probe.go b/prog/probe.go index c3ba714963..65f52ed5d3 100644 --- a/prog/probe.go +++ b/prog/probe.go @@ -145,10 +145,9 @@ func probeMain(flags probeFlags) { p.AddReporter(process.NewReporter(processCache, hostID, process.GetDeltaTotalJiffies)) } - // TODO: make the snooper optional dnsSnooper, err := endpoint.NewDNSSnooper() if err != nil { - log.Errorf("Fail to start DNS snooper: nodes for external services will be less accurate: %s", err) + log.Errorf("Failed to start DNS snooper: nodes for external services will be less accurate: %s", err) } else { defer dnsSnooper.Stop() }