Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ensure connections from /proc/net/tcp{,6} get the right pid
ProcNet.Next does not allocate Connection structs, for efficiency. Instead it always returns a *Connection pointing to the same instance. As a result, any mutations by the caller to struct elements that aren't actually set by ProcNet.Next, in particular Connection.Proc, are carried across to subsequent calls. This had hilarious consequences: connections referencing an inode which we hadn't come across during proc walking would be associated with the process corresponding to the last successfully looked up inode. The fix is to clear out the garbage left over from previous calls. Fixes #2638.
- Loading branch information