go-netstat
go-netstat copied to clipboard
Process.Name or Process.Pid can not be filtered
The following code will throw panic: "tabs, err := netstat.TCPSocks(func(s *netstat.SockTabEntry) bool { return s.Process.Pid == 6720 })" or "tabs, err := netstat.TCPSocks(func(s *netstat.SockTabEntry) bool { return s.Process.Pname == "chrome" })" panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x511799]
The following code will throw panic: "tabs, err := netstat.TCPSocks(func(s *netstat.SockTabEntry) bool { return s.Process.Pid == 6720 })" or "tabs, err := netstat.TCPSocks(func(s *netstat.SockTabEntry) bool { return s.Process.Pname == "chrome" })" panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x511799]
Same issue. Always throws panic when runs TCPsocks but not UDPsocks.
The following code will throw panic: "tabs, err := netstat.TCPSocks(func(s *netstat.SockTabEntry) bool { return s.Process.Pid == 6720 })" or "tabs, err := netstat.TCPSocks(func(s *netstat.SockTabEntry) bool { return s.Process.Pname == "chrome" })" panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x511799]
Same issue. Always throws panic when runs TCPsocks but not UDPsocks.
check https://github.com/cakturk/go-netstat/pull/13