Merge pull request #2639 from weaveworks/2638-connection-pid-pollution

ensure connections from /proc/net/tcp{,6} get the right pid

Fixes #2638.
This commit is contained in:
Matthias Radestock
2017-06-26 09:09:44 +01:00
committed by GitHub

View File

@@ -28,6 +28,11 @@ func (c *pnConnIter) Next() *Connection {
}
if proc, ok := c.procs[n.Inode]; ok {
n.Proc = *proc
} else {
// ProcNet.Next() always returns a pointer to the same
// struct. We therefore must clear any garbage left over from
// the previous call.
n.Proc = Proc{}
}
return n
}