Skip to content

Commit

Permalink
Merge pull request #770 from weaveworks/missing-pids
Browse files Browse the repository at this point in the history
We need to read /proc/PID/net/tcp6 to see the pids for the server end of local connections.
  • Loading branch information
paulbellamy committed Dec 15, 2015
2 parents 3bc2042 + 550f215 commit 3e2e92e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions probe/endpoint/procspy/proc.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ func walkProcPid(buf *bytes.Buffer, walker process.Walker) (map[uint64]*Proc, er
}
hasConns, ok := namespaces[statT.Ino]
if !ok {
read, err := readFile(filepath.Join(procRoot, dirName, "/net/tcp"), buf)
hasConns = err == nil && read > 0
read, _ := readFile(filepath.Join(procRoot, dirName, "/net/tcp"), buf)
read6, _ := readFile(filepath.Join(procRoot, dirName, "/net/tcp6"), buf)
hasConns = read+read6 > 0
namespaces[statT.Ino] = hasConns
}
if !hasConns {
Expand Down

0 comments on commit 3e2e92e

Please sign in to comment.