[net][linux] Support socket tables in nested namespaces

Signed-off-by: Joe Stringer <joe@cilium.io>
This commit is contained in:
Joe Stringer 2018-11-09 14:54:37 -08:00 committed by Joe Stringer
parent 0f70a4a06f
commit f87d9813da
1 changed files with 5 additions and 1 deletions

View File

@ -393,7 +393,11 @@ func statsFromInodes(root string, pid int32, tmap []netConnectionKindType, inode
var path string
var connKey string
var ls []connTmp
path = fmt.Sprintf("%s/net/%s", root, t.filename)
if pid == 0 {
path = fmt.Sprintf("%s/net/%s", root, t.filename)
} else {
path = fmt.Sprintf("%s/%d/net/%s", root, pid, t.filename)
}
switch t.family {
case syscall.AF_INET, syscall.AF_INET6:
ls, err = processInet(path, t, inodes, pid)