shirou / gopsutil

psutil for golang
Other
10.47k stars 1.58k forks source link

Improper types can get assigned #1679

Open nf-brentsaner opened 1 month ago

nf-brentsaner commented 1 month ago

Describe the bug The ConnectionState.Type is decided by which family it is, e.g.: https://github.com/shirou/gopsutil/blob/master/net/net_linux.go#L456

This is incorrect, as there can be e.g. syscall.SOCK_STREAM types of syscall.AF_UNIX connections.

To Reproduce N/A

Expected behavior This should be determined as reported by the kernel and not a map.

Environment (please complete the following information): (See above example; Linux)

Additional context N/A