respect UseConntrack setting in ebpf initialisation

This commit is contained in:
Matthias Radestock
2017-07-10 07:37:23 +01:00
parent 7ea0800f8b
commit 8bd0188537

View File

@@ -116,7 +116,9 @@ func (t *connectionTracker) performFlowWalk(rpt *report.Report) map[string]fourT
func (t *connectionTracker) existingFlows() map[string]fourTuple {
seenTuples := map[string]fourTuple{}
if err := IsConntrackSupported(t.conf.ProcRoot); t.conf.UseConntrack && err != nil {
if !t.conf.UseConntrack {
// log.Warnf("Not using conntrack: disabled")
} else if err := IsConntrackSupported(t.conf.ProcRoot); err != nil {
log.Warnf("Not using conntrack: not supported by the kernel: %s", err)
} else if existingFlows, err := existingConnections([]string{"--any-nat"}); err != nil {
log.Errorf("conntrack existingConnections error: %v", err)