Merge pull request #358 from ablagoev/optimize-net-connections

Fromat socketType properly in tcp duplication check key
tags/v2.17.04 v2.17.04
shirou 8 years ago committed by GitHub
commit 9af92986dd

@ -375,7 +375,7 @@ func statsFromInodes(root string, pid int32, tmap []netConnectionKindType, inode
// Build TCP key to id the connection uniquely // Build TCP key to id the connection uniquely
// socket type, src ip, src port, dst ip, dst port and state should be enough // socket type, src ip, src port, dst ip, dst port and state should be enough
// to prevent duplications. // to prevent duplications.
connKey = fmt.Sprintf("%s-%s:%d-%s:%d-%s", c.sockType, c.laddr.IP, c.laddr.Port, c.raddr.IP, c.raddr.Port, c.status) connKey = fmt.Sprintf("%d-%s:%d-%s:%d-%s", c.sockType, c.laddr.IP, c.laddr.Port, c.raddr.IP, c.raddr.Port, c.status)
if _, ok := dupCheckMap[connKey]; ok { if _, ok := dupCheckMap[connKey]; ok {
continue continue
} }

Loading…
Cancel
Save