Skip to content

Commit

Permalink
Remove TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfonso Acosta committed Sep 20, 2016
1 parent 30f8d30 commit 01c713f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
8 changes: 1 addition & 7 deletions probe/endpoint/dns_snooper_linux_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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, &eth, &ip4, &ip6, &udp, &tcp, &dns)

for {
Expand Down
3 changes: 1 addition & 2 deletions prog/probe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down

0 comments on commit 01c713f

Please sign in to comment.